aboutsummaryrefslogtreecommitdiff
path: root/backend/handlers
diff options
context:
space:
mode:
authorArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2023-08-30 16:40:27 +0300
committerArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2023-08-30 16:40:27 +0300
commit5a285a5d811a955a8eb380a598595e159e9935e5 (patch)
tree12a0dff07a3ff912e232f21d8ee638f359b3668d /backend/handlers
parentdocs: map leaderboards response (diff)
downloadlphub-5a285a5d811a955a8eb380a598595e159e9935e5.tar.gz
lphub-5a285a5d811a955a8eb380a598595e159e9935e5.tar.bz2
lphub-5a285a5d811a955a8eb380a598595e159e9935e5.zip
fix: actually get is_coop data for the given map (#45)
Former-commit-id: f29b6ca5d0e23ae622451b011e7d64758a8f598c
Diffstat (limited to 'backend/handlers')
-rw-r--r--backend/handlers/map.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/backend/handlers/map.go b/backend/handlers/map.go
index 9b0caef..0a0206e 100644
--- a/backend/handlers/map.go
+++ b/backend/handlers/map.go
@@ -139,12 +139,12 @@ func FetchMapLeaderboards(c *gin.Context) {
139 return 139 return
140 } 140 }
141 response.Map.ID = intID 141 response.Map.ID = intID
142 sql := `SELECT g.name, c.name, m.name, is_disabled, m.image 142 sql := `SELECT g.name, c.name, m.name, is_disabled, m.image, g.is_coop
143 FROM maps m 143 FROM maps m
144 INNER JOIN games g ON m.game_id = g.id 144 INNER JOIN games g ON m.game_id = g.id
145 INNER JOIN chapters c ON m.chapter_id = c.id 145 INNER JOIN chapters c ON m.chapter_id = c.id
146 WHERE m.id = $1` 146 WHERE m.id = $1`
147 err = database.DB.QueryRow(sql, id).Scan(&response.Map.GameName, &response.Map.ChapterName, &response.Map.MapName, &isDisabled, &response.Map.Image) 147 err = database.DB.QueryRow(sql, id).Scan(&response.Map.GameName, &response.Map.ChapterName, &response.Map.MapName, &isDisabled, &response.Map.Image, &response.Map.IsCoop)
148 if err != nil { 148 if err != nil {
149 c.JSON(http.StatusBadRequest, models.ErrorResponse(err.Error())) 149 c.JSON(http.StatusBadRequest, models.ErrorResponse(err.Error()))
150 return 150 return