Commit 8447e28a authored by Frederik Wegner's avatar Frederik Wegner

Apply suggestion to endpoint/duel/query.go

parent 120691eb
Pipeline #1672 passed with stages
in 19 minutes and 14 seconds
......@@ -783,7 +783,7 @@ func (m *MySQLDuelQuery) SetPool(duelID, poolID, userID uint32) (*schemas.DuelSc
user2 := duel.Participants[1].ID
// Check if selected pool exists
pool := db.QueryRow("SELECT COUNT(*) FROM ((SELECT `user` FROM `user_pool` WHERE `pool`=? AND `user`=?) UNION (SELECT `user` FROM `user_pool` WHERE `pool`=? AND `user`=?)) AS Q", poolID, user1, poolID, user2)
pool := db.QueryRow("SELECT COUNT(DISTINCT `user`) FROM ((SELECT `user` FROM `user_pool` WHERE `pool`=? AND `user`=?) UNION (SELECT `user` FROM `user_pool` WHERE `pool`=? AND `user`=?)) AS Q", poolID, user1, poolID, user2)
var c uint32
if err := pool.Scan(&c); err != nil || c != 2 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment