diff options
| -rw-r--r-- | backend/handlers/record.go | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/backend/handlers/record.go b/backend/handlers/record.go index 9b8e207..2c763f9 100644 --- a/backend/handlers/record.go +++ b/backend/handlers/record.go | |||
| @@ -65,8 +65,8 @@ func CreateRecordWithDemo(c *gin.Context) { | |||
| 65 | var gameName string | 65 | var gameName string |
| 66 | var isCoop bool | 66 | var isCoop bool |
| 67 | var isDisabled bool | 67 | var isDisabled bool |
| 68 | sql := `SELECT g.name, m.is_disabled FROM maps m INNER JOIN games g ON m.game_id=g.id WHERE m.id = $1` | 68 | sql := `SELECT g.name, g.is_coop, m.is_disabled FROM maps m INNER JOIN games g ON m.game_id=g.id WHERE m.id = $1` |
| 69 | err = database.DB.QueryRow(sql, mapID).Scan(&gameName, &isDisabled) | 69 | err = database.DB.QueryRow(sql, mapID).Scan(&gameName, &isCoop, &isDisabled) |
| 70 | if err != nil { | 70 | if err != nil { |
| 71 | c.JSON(http.StatusOK, models.ErrorResponse(err.Error())) | 71 | c.JSON(http.StatusOK, models.ErrorResponse(err.Error())) |
| 72 | return | 72 | return |
| @@ -75,9 +75,6 @@ func CreateRecordWithDemo(c *gin.Context) { | |||
| 75 | c.JSON(http.StatusOK, models.ErrorResponse("Map is not available for competitive boards.")) | 75 | c.JSON(http.StatusOK, models.ErrorResponse("Map is not available for competitive boards.")) |
| 76 | return | 76 | return |
| 77 | } | 77 | } |
| 78 | if gameName == "Portal 2 - Cooperative" { | ||
| 79 | isCoop = true | ||
| 80 | } | ||
| 81 | // Get record request | 78 | // Get record request |
| 82 | var record RecordRequest | 79 | var record RecordRequest |
| 83 | if err := c.ShouldBind(&record); err != nil { | 80 | if err := c.ShouldBind(&record); err != nil { |