aboutsummaryrefslogtreecommitdiff
path: root/backend/controllers
diff options
context:
space:
mode:
authorArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2023-07-10 16:06:29 +0300
committerArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2023-07-10 16:06:29 +0300
commit3ad53aeeffec00f85bf1f3168d0e9d61c65eecb7 (patch)
tree7cfc4a6fbc865f9aeddb3a41febd795b20b69609 /backend/controllers
parentfeat: add chapter numbers in names (diff)
downloadlphub-3ad53aeeffec00f85bf1f3168d0e9d61c65eecb7.tar.gz
lphub-3ad53aeeffec00f85bf1f3168d0e9d61c65eecb7.tar.bz2
lphub-3ad53aeeffec00f85bf1f3168d0e9d61c65eecb7.zip
feat: is_coop field on games
Former-commit-id: bf3a5a262557ade646ce8e59db152be8c521ac06
Diffstat (limited to 'backend/controllers')
-rw-r--r--backend/controllers/mapController.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/backend/controllers/mapController.go b/backend/controllers/mapController.go
index 52b6623..11e56f6 100644
--- a/backend/controllers/mapController.go
+++ b/backend/controllers/mapController.go
@@ -193,7 +193,7 @@ func FetchMapLeaderboards(c *gin.Context) {
193// @Failure 400 {object} models.Response 193// @Failure 400 {object} models.Response
194// @Router /games [get] 194// @Router /games [get]
195func FetchGames(c *gin.Context) { 195func FetchGames(c *gin.Context) {
196 rows, err := database.DB.Query(`SELECT id, name FROM games`) 196 rows, err := database.DB.Query(`SELECT id, name, is_coop FROM games`)
197 if err != nil { 197 if err != nil {
198 c.JSON(http.StatusBadRequest, models.ErrorResponse(err.Error())) 198 c.JSON(http.StatusBadRequest, models.ErrorResponse(err.Error()))
199 return 199 return
@@ -201,7 +201,7 @@ func FetchGames(c *gin.Context) {
201 var games []models.Game 201 var games []models.Game
202 for rows.Next() { 202 for rows.Next() {
203 var game models.Game 203 var game models.Game
204 if err := rows.Scan(&game.ID, &game.Name); err != nil { 204 if err := rows.Scan(&game.ID, &game.Name, &game.IsCoop); err != nil {
205 c.JSON(http.StatusBadRequest, models.ErrorResponse(err.Error())) 205 c.JSON(http.StatusBadRequest, models.ErrorResponse(err.Error()))
206 return 206 return
207 } 207 }