Fix puzzles tags in admin routes

This commit is contained in:
jeffcheasey88 2024-04-01 21:26:57 +02:00
parent 15f0791777
commit f6d2d7f96f

View file

@ -101,8 +101,8 @@ public enum DatabaseQuery {
ADD_PUZZLE("INSERT INTO puzzles (name, content, soluce, verify, score_max, fk_chapter) VALUES (?,?,?,?,?,?)"), ADD_PUZZLE("INSERT INTO puzzles (name, content, soluce, verify, score_max, fk_chapter) VALUES (?,?,?,?,?,?)"),
DELETE_PUZZLE("DELETE FROM puzzles WHERE id_puzzle = ?"), DELETE_PUZZLE("DELETE FROM puzzles WHERE id_puzzle = ?"),
EDIT_PUZZLE("UPDATE puzzles SET name = ?, content = ?, soluce = ?, verify = ?, score_max = ?, fk_chapter = ? WHERE id_puzzle = ?"), EDIT_PUZZLE("UPDATE puzzles SET name = ?, content = ?, soluce = ?, verify = ?, score_max = ?, fk_chapter = ? WHERE id_puzzle = ?"),
GET_PUZZLE("SELECT * FROM puzzles p LEFT JOIN containsTags ct ON ct.fk_puzzle = p.id_puzzle LEFT JOIN tags t ON t.id_tag = ct.fk_tag WHERE p.id_puzzle = ?"), GET_PUZZLE("SELECT p.*, GROUP_CONCAT(t.name) AS tags FROM puzzles p LEFT JOIN containsTags ct ON ct.fk_puzzle = p.id_puzzle LEFT JOIN tags t ON t.id_tag = ct.fk_tag WHERE p.id_puzzle = ? GROUP BY p.id_puzzle"),
GET_PUZZLES("SELECT * FROM puzzles p LEFT JOIN containsTags ct ON ct.fk_puzzle = p.id_puzzle LEFT JOIN tags t ON t.id_tag = ct.fk_tag"), GET_PUZZLES("SELECT p.*, GROUP_CONCAT(t.name) AS tags FROM puzzles p LEFT JOIN containsTags ct ON ct.fk_puzzle = p.id_puzzle LEFT JOIN tags t ON t.id_tag = ct.fk_tag GROUP BY p.id_puzzle"),
ADD_TAG("INSERT INTO tags (name) VALUES (?)"), ADD_TAG("INSERT INTO tags (name) VALUES (?)"),
DELETE_TAG("DELETE FROM tags WHERE id_tag = ?"), DELETE_TAG("DELETE FROM tags WHERE id_tag = ?"),