diff options
author | xengineering <me@xengineering.eu> | 2023-04-26 07:05:02 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-04-28 10:44:29 +0200 |
commit | f624c71a26a522b2ea387a9f7e9f6ec84341b704 (patch) | |
tree | 2efceb70311592e7a7fe0bdbbd47128f8e2e5b7a | |
parent | 12daf84f2df56b639f7f37a7894612d5355a7c37 (diff) | |
download | ceres-f624c71a26a522b2ea387a9f7e9f6ec84341b704.tar ceres-f624c71a26a522b2ea387a9f7e9f6ec84341b704.tar.zst ceres-f624c71a26a522b2ea387a9f7e9f6ec84341b704.zip |
Fix add_recipes with default JSON
-rw-r--r-- | handler.go | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -170,8 +170,10 @@ func addRecipesGet(w http.ResponseWriter, r *http.Request) { return } + rec, _ := json.MarshalIndent(recipe{}, "", " ") + textpath := filepath.Join(config.Data, "recipes", newIdStr, "text") - err = os.WriteFile(textpath, make([]byte, 0), 0644) + err = os.WriteFile(textpath, rec, 0644) if err != nil { http.Error(w, "Could not create new recipe!", 500) return |