diff options
author | xengineering <me@xengineering.eu> | 2024-05-17 23:08:05 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2024-05-17 23:10:17 +0200 |
commit | 5d5580285a366e37ac00a4e1a6f2f1bda853ff28 (patch) | |
tree | d9334e5941ec02fb477d6d4335d69a348d6d9b18 | |
parent | 5eca3267d37cdc51f775b5452727efebbb7e7e9e (diff) | |
download | ceres-5d5580285a366e37ac00a4e1a6f2f1bda853ff28.tar ceres-5d5580285a366e37ac00a4e1a6f2f1bda853ff28.tar.zst ceres-5d5580285a366e37ac00a4e1a6f2f1bda853ff28.zip |
model: Fix ignored error
An ignored return value here caused a serious bug as soon as validation
for ingredients was tried. The validation could raise an error e.g. on a
negative amount for the ingredient. This error was ignored at the
changed line which resulted into deleted ingredients for the whole
recipe.
-rw-r--r-- | model/recipe.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/model/recipe.go b/model/recipe.go index a9bd0fe..e49c188 100644 --- a/model/recipe.go +++ b/model/recipe.go @@ -201,7 +201,7 @@ func (r *Recipe) Update(tx *sql.Tx) error { for i := range r.Steps { r.Steps[i].Index = fmt.Sprint(i) r.Steps[i].Recipe = r.Id - r.Steps[i].Create(tx) + err = r.Steps[i].Create(tx) if err != nil { return err } |