diff options
Diffstat (limited to 'backend')
| -rw-r--r-- | backend/handlers/map.go | 4 | ||||
| -rw-r--r-- | backend/models/models.go | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/backend/handlers/map.go b/backend/handlers/map.go index c0776d1..954d720 100644 --- a/backend/handlers/map.go +++ b/backend/handlers/map.go | |||
| @@ -71,12 +71,12 @@ func FetchMapSummary(c *gin.Context) { | |||
| 71 | } | 71 | } |
| 72 | // Get map data | 72 | // Get map data |
| 73 | response.Map.ID = intID | 73 | response.Map.ID = intID |
| 74 | sql := `SELECT m.id, g.name, c.name, m.name, m.image, g.is_coop | 74 | sql := `SELECT m.id, g.name, c.name, m.name, m.image, g.is_coop, m.is_disabled |
| 75 | FROM maps m | 75 | FROM maps m |
| 76 | INNER JOIN games g ON m.game_id = g.id | 76 | INNER JOIN games g ON m.game_id = g.id |
| 77 | INNER JOIN chapters c ON m.chapter_id = c.id | 77 | INNER JOIN chapters c ON m.chapter_id = c.id |
| 78 | WHERE m.id = $1` | 78 | WHERE m.id = $1` |
| 79 | err = database.DB.QueryRow(sql, id).Scan(&response.Map.ID, &response.Map.GameName, &response.Map.ChapterName, &response.Map.MapName, &response.Map.Image, &response.Map.IsCoop) | 79 | err = database.DB.QueryRow(sql, id).Scan(&response.Map.ID, &response.Map.GameName, &response.Map.ChapterName, &response.Map.MapName, &response.Map.Image, &response.Map.IsCoop, &response.Map.IsDisabled) |
| 80 | if err != nil { | 80 | if err != nil { |
| 81 | c.JSON(http.StatusOK, models.ErrorResponse(err.Error())) | 81 | c.JSON(http.StatusOK, models.ErrorResponse(err.Error())) |
| 82 | return | 82 | return |
diff --git a/backend/models/models.go b/backend/models/models.go index 8e16c1c..fa26be3 100644 --- a/backend/models/models.go +++ b/backend/models/models.go | |||
| @@ -46,6 +46,7 @@ type Map struct { | |||
| 46 | MapName string `json:"map_name"` | 46 | MapName string `json:"map_name"` |
| 47 | Image string `json:"image"` | 47 | Image string `json:"image"` |
| 48 | IsCoop bool `json:"is_coop"` | 48 | IsCoop bool `json:"is_coop"` |
| 49 | IsDisabled bool `json:"is_disabled"` | ||
| 49 | } | 50 | } |
| 50 | 51 | ||
| 51 | type MapShort struct { | 52 | type MapShort struct { |