aboutsummaryrefslogtreecommitdiff
path: root/modules/lists
diff options
context:
space:
mode:
authorkeiser <keiserwiliem@googlemail.com>2016-11-04 17:15:34 (UTC)
committerkeiser <keiserwiliem@googlemail.com>2016-11-04 17:15:34 (UTC)
commit1a3ddb12843eaacca2a6109333331f92eee2603c (patch)
treeed4025e3d1f0d693b96d1c4f35d35e85f098de55 /modules/lists
parentbd8b61a5167132754b944a653260ddd71ff79a60 (diff)
Ich bin halt einfach der Beste
Diffstat (limited to 'modules/lists')
-rw-r--r--modules/lists/lists.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/lists/lists.go b/modules/lists/lists.go
index c699271..455c39c 100644
--- a/modules/lists/lists.go
+++ b/modules/lists/lists.go
@@ -695,7 +695,7 @@ func (m *Module) removeGrilFromList(w http.ResponseWriter, r *http.Request, p ht
695 return 695 return
696 } 696 }
697 697
698 err = m.g.DB.QueryRow(`DELETE FROM grilist.lists_grils WHERE list_id=$1 AND gril_id=$2`, listID, grilID).Scan(&oldOrder) 698 err = m.g.DB.QueryRow(`DELETE FROM grilist.lists_grils WHERE list_id=$1 AND gril_id=$2 RETURNING "order"`, listID, grilID).Scan(&oldOrder)
699 if err != nil { 699 if err != nil {
700 log.Println("error removing gril:", err) 700 log.Println("error removing gril:", err)
701 http.Error(w, "could not remove gril", 500) 701 http.Error(w, "could not remove gril", 500)
@@ -708,6 +708,12 @@ func (m *Module) removeGrilFromList(w http.ResponseWriter, r *http.Request, p ht
708 http.Error(w, "could not remove gril", 500) 708 http.Error(w, "could not remove gril", 500)
709 return 709 return
710 } 710 }
711
712 if r, err := res.RowsAffected(); err != nil || r == 0 {
713 log.Println("invalid rows affected in removing gril")
714 http.Error(w, "gril not in list / other error", 500)
715 return
716 }
711 717
712 list.Grils = list.Grils[:0] 718 list.Grils = list.Grils[:0]
713 719