summaryrefslogtreecommitdiff
path: root/controller
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-03-03 17:23:09 +0100
committerxengineering <me@xengineering.eu>2024-03-03 19:22:30 +0100
commitfa4c7e7af50817bc895f56f3fa25b50b8444407d (patch)
treee2259b98bf0e48ce323ad1c6bea31cd78143c30f /controller
parentfc8160d4404f18042b7d265f2f595e4a3d75242b (diff)
downloadceres-fa4c7e7af50817bc895f56f3fa25b50b8444407d.tar
ceres-fa4c7e7af50817bc895f56f3fa25b50b8444407d.tar.zst
ceres-fa4c7e7af50817bc895f56f3fa25b50b8444407d.zip
view: Add recipe create
Diffstat (limited to 'controller')
-rw-r--r--controller/recipe.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/controller/recipe.go b/controller/recipe.go
index a2e5ab6..818a077 100644
--- a/controller/recipe.go
+++ b/controller/recipe.go
@@ -12,6 +12,7 @@ import (
func RecipeCreate(w http.ResponseWriter, r *http.Request) {
recipe := model.Recipe{}
+ recipe.Title = "recipe without title"
err := recipe.Create()
if err != nil {
@@ -19,7 +20,7 @@ func RecipeCreate(w http.ResponseWriter, r *http.Request) {
return
}
- http.Redirect(w, r, "/recipe/" + recipe.Id, http.StatusSeeOther)
+ http.Redirect(w, r, "/recipe/" + recipe.Id + "?view=recipe-edit", http.StatusSeeOther)
}
func RecipeUpdate(w http.ResponseWriter, r *http.Request) {