aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2023-09-28 18:49:17 +0300
committerGitHub <noreply@github.com>2023-09-28 18:49:17 +0300
commit4ba6cecbb20a5af1e598a2d67f3d2476a2b1f5e1 (patch)
tree4f88bd2105b54259c452e88cdef052c9d924b1bc /backend
parentfix: actually get log message in modlogs (#110) (diff)
downloadlphub-4ba6cecbb20a5af1e598a2d67f3d2476a2b1f5e1.tar.gz
lphub-4ba6cecbb20a5af1e598a2d67f3d2476a2b1f5e1.tar.bz2
lphub-4ba6cecbb20a5af1e598a2d67f3d2476a2b1f5e1.zip
feat: add is_deleted data to map summary (#109)
Former-commit-id: de8434e14fc35df28e2cc5ed0c4f31bfa741c7d6
Diffstat (limited to 'backend')
-rw-r--r--backend/handlers/map.go4
-rw-r--r--backend/models/models.go1
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
51type MapShort struct { 52type MapShort struct {