diff options
author | Tucker Evans <tuckerevans24@gmail.com> | 2019-11-12 09:25:05 -0500 |
---|---|---|
committer | Tucker Evans <tuckerevans24@gmail.com> | 2019-11-12 09:26:42 -0500 |
commit | 16e187899c1cd008a5d36d4ac772a7bbc854e165 (patch) | |
tree | 9dd2e483c7130f0591242e5641c7bca08493a1d3 /backend/main.go | |
parent | b84c2d1ec6acb70f76a03010b1fdc868cf3d485e (diff) |
Fix change QueryRow to Exec for ingredient/step inserts
Changed database schema so ingredients & steps does not have an id, and
therefore can't return it so instead we just exec the insert statement
without returning anything.
We do have to check that there were affected rows in order to accurately
update the recipe object.
Diffstat (limited to 'backend/main.go')
-rw-r--r-- | backend/main.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/backend/main.go b/backend/main.go index b4cd76f..856cd80 100644 --- a/backend/main.go +++ b/backend/main.go @@ -173,7 +173,7 @@ func SingleRecipe(w http.ResponseWriter, r *http.Request) { var status int var msg string - if res.RowsAffected() == 0 { + if ra, _ := res.RowsAffected(); ra == 0 { status = http.StatusNotFound msg = "Recipe Not found" } else { |