aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrtz12 <koenig@fagott.pw>2017-04-12 17:54:28 (UTC)
committerrtz12 <koenig@fagott.pw>2017-04-12 17:54:28 (UTC)
commit7ac912e86c0c2592481eea531e837f31132adf6a (patch)
tree2b0970a039a6a98da1acccdb8f35a855da351271
parentbb6506acf3abbdadfb9f488a87e9a65779584407 (diff)
Der Rang kommt jetzt auch noch
-rw-r--r--modules/lists/lists.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/lists/lists.go b/modules/lists/lists.go
index 94d485e..215ab9c 100644
--- a/modules/lists/lists.go
+++ b/modules/lists/lists.go
@@ -540,8 +540,10 @@ func (m *Module) addGrilToList(w http.ResponseWriter, r *http.Request, p httprou
540 } 540 }
541 541
542 // rein in die DB damit 542 // rein in die DB damit
543 _, err = m.g.DB.Exec(`INSERT INTO grilist.lists_grils(list_id, gril_id, "order") 543 row := m.g.DB.QueryRow(`INSERT INTO grilist.lists_grils(list_id, gril_id, "order")
544 VALUES($1, $2, (SELECT count(gril_id) FROM grilist.lists_grils WHERE list_id = $1));`, listID, grilID) 544 VALUES($1, $2, (SELECT count(gril_id) FROM grilist.lists_grils WHERE list_id = $1)) RETURNING "order";`, listID, grilID)
545 var rank int
546 err = row.Scan(&rank)
545 if err != nil { 547 if err != nil {
546 log.Println("error inserting gril into list:", err) 548 log.Println("error inserting gril into list:", err)
547 http.Error(w, "could not insert gril", 500) 549 http.Error(w, "could not insert gril", 500)