diff options
author | xengineering <me@xengineering.eu> | 2023-04-22 20:28:54 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-04-22 20:28:54 +0200 |
commit | 13542dd8073ee48aa25ef4958fd2b2da5d848092 (patch) | |
tree | 5b9f507530ca346d355d0ae88a9a95ab3945fa0b /handler.go | |
parent | 1dec0af24f22755e3d6debecaa8635dcab918698 (diff) | |
download | ceres-13542dd8073ee48aa25ef4958fd2b2da5d848092.tar ceres-13542dd8073ee48aa25ef4958fd2b2da5d848092.tar.zst ceres-13542dd8073ee48aa25ef4958fd2b2da5d848092.zip |
Update edit page
Diffstat (limited to 'handler.go')
-rw-r--r-- | handler.go | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -61,10 +61,17 @@ func recipeEditGet(w http.ResponseWriter, r *http.Request) { return } + rec, err := getRecipe(idStr) + if err != nil { + http.Error(w, "Could not get recipe.", 400) + return + } + recipe := struct{ - Id string - Text string - }{idStr, string(text)} + Id string + Title string + Text string + }{idStr, rec.Title, string(text)} ServeTemplate(w, "recipe_edit.html", recipe) } |