diff options
Diffstat (limited to 'controller/recipe.go')
-rw-r--r-- | controller/recipe.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/controller/recipe.go b/controller/recipe.go index 9427b0d..9529b2a 100644 --- a/controller/recipe.go +++ b/controller/recipe.go @@ -19,7 +19,7 @@ func RecipeCreate(w http.ResponseWriter, r *http.Request) { recipe.Created = recipe.LastChanged var obj model.Object = &recipe - err := model.SafeCrud(obj.Create) + err := model.Transaction(obj.Create) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return @@ -50,7 +50,7 @@ func RecipeUpdate(w http.ResponseWriter, r *http.Request) { recipe.LastChanged = fmt.Sprint(time.Now().Unix()) var obj model.Object = &recipe - err = model.SafeCrud(obj.Update) + err = model.Transaction(obj.Update) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return @@ -64,7 +64,7 @@ func RecipeDelete(w http.ResponseWriter, r *http.Request) { recipe.Id = mux.Vars(r)[`id`] var obj model.Object = &recipe - err := model.SafeCrud(obj.Delete) + err := model.Transaction(obj.Delete) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return |