Fix minor error on water submission without photos
This commit is contained in:
parent
8bd83207dd
commit
11011f3804
1 changed files with 6 additions and 4 deletions
10
rmo/water.go
10
rmo/water.go
|
|
@ -188,10 +188,12 @@ func postWater(w http.ResponseWriter, r *http.Request) {
|
|||
PoolID: omit.From(int32(pool.ID)),
|
||||
})
|
||||
}
|
||||
_, err = models.PublicreportPoolImages.Insert(bob.ToMods(setters...)).Exec(r.Context(), tx)
|
||||
if err != nil {
|
||||
respondError(w, "Failed to save upload relationships", err, http.StatusInternalServerError)
|
||||
return
|
||||
if len(setters) > 0 {
|
||||
_, err = models.PublicreportPoolImages.Insert(bob.ToMods(setters...)).Exec(r.Context(), tx)
|
||||
if err != nil {
|
||||
respondError(w, "Failed to save upload relationships", err, http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
}
|
||||
tx.Commit(ctx)
|
||||
http.Redirect(w, r, fmt.Sprintf("/pool-submit-complete?report=%s", public_id), http.StatusFound)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue