diff options
author | keiser <keiserwiliem@googlemail.com> | 2016-11-05 02:00:32 (UTC) |
---|---|---|
committer | keiser <keiserwiliem@googlemail.com> | 2016-11-05 02:00:32 (UTC) |
commit | 2492936d542e3c2578ca4d06c9f3f59238fb2eb4 (patch) | |
tree | 78941fce4c5a08001da5977d925b2d0310b14334 /modules/lists | |
parent | fdf858e0eabd107e2815b0e562e06f55f93a2d3b (diff) |
Drucker meinte das zeug braucht man nichtmehr
Diffstat (limited to 'modules/lists')
-rw-r--r-- | modules/lists/lists.go | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/modules/lists/lists.go b/modules/lists/lists.go index b346dd5..d411209 100644 --- a/modules/lists/lists.go +++ b/modules/lists/lists.go | |||
@@ -702,18 +702,13 @@ func (m *Module) removeGrilFromList(w http.ResponseWriter, r *http.Request, p ht | |||
702 | return | 702 | return |
703 | } | 703 | } |
704 | 704 | ||
705 | res, err := m.g.DB.Exec(`UPDATE grilist.lists_grils SET "order" = "order" - 1 WHERE list_id = $1 AND "order" > $2`, listID, oldOrder) | 705 | _, err := m.g.DB.Exec(`UPDATE grilist.lists_grils SET "order" = "order" - 1 WHERE list_id = $1 AND "order" > $2`, listID, oldOrder) |
706 | if err != nil { | 706 | if err != nil { |
707 | log.Println("error removing gril:", err) | 707 | log.Println("error removing gril:", err) |
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 | 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 | } | ||
717 | 712 | ||
718 | list.Grils = list.Grils[:0] | 713 | list.Grils = list.Grils[:0] |
719 | 714 | ||