diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2025-03-19 15:53:30 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-19 15:53:30 +0000 |
| commit | d221c8a770fa0d01fc191e88b2fda8d7d0faa049 (patch) | |
| tree | ac91a184dd27b7e7d402db4cd85b7b6bfb131535 /backend/handlers/map.go | |
| parent | fix/frontend: broken summary difficulty (#270) (diff) | |
| download | lphub-d221c8a770fa0d01fc191e88b2fda8d7d0faa049.tar.gz lphub-d221c8a770fa0d01fc191e88b2fda8d7d0faa049.tar.bz2 lphub-d221c8a770fa0d01fc191e88b2fda8d7d0faa049.zip | |
feat/backend: send map difficulty in summary (#271)
Diffstat (limited to 'backend/handlers/map.go')
| -rw-r--r-- | backend/handlers/map.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/backend/handlers/map.go b/backend/handlers/map.go index e1e6897..9cb0bcc 100644 --- a/backend/handlers/map.go +++ b/backend/handlers/map.go | |||
| @@ -77,12 +77,12 @@ func FetchMapSummary(c *gin.Context) { | |||
| 77 | } | 77 | } |
| 78 | // Get map data | 78 | // Get map data |
| 79 | response.Map.ID = intID | 79 | response.Map.ID = intID |
| 80 | sql := `SELECT m.id, g.name, c.name, m.name, m.image, g.is_coop, m.is_disabled | 80 | sql := `SELECT m.id, g.name, c.name, m.name, m.image, g.is_coop, m.is_disabled, m.difficulty |
| 81 | FROM maps m | 81 | FROM maps m |
| 82 | INNER JOIN games g ON m.game_id = g.id | 82 | INNER JOIN games g ON m.game_id = g.id |
| 83 | INNER JOIN chapters c ON m.chapter_id = c.id | 83 | INNER JOIN chapters c ON m.chapter_id = c.id |
| 84 | WHERE m.id = $1` | 84 | WHERE m.id = $1` |
| 85 | 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) | 85 | 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, &response.Map.Difficulty) |
| 86 | if err != nil { | 86 | if err != nil { |
| 87 | c.JSON(http.StatusOK, models.ErrorResponse(err.Error())) | 87 | c.JSON(http.StatusOK, models.ErrorResponse(err.Error())) |
| 88 | return | 88 | return |