diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-08-12 05:54:37 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-08-12 05:54:37 +0900 |
| commit | b37d6f213c2f3b19631e5067f39a7106859faaed (patch) | |
| tree | 3c45267ee25aa78be1ad4c31e0c09894e656b506 /backend/admin/handler.go | |
| parent | 545d86085f927bded852dd5a8ee8341f60f24d84 (diff) | |
| download | iosdc-japan-2025-albatross-b37d6f213c2f3b19631e5067f39a7106859faaed.tar.gz iosdc-japan-2025-albatross-b37d6f213c2f3b19631e5067f39a7106859faaed.tar.zst iosdc-japan-2025-albatross-b37d6f213c2f3b19631e5067f39a7106859faaed.zip | |
feat: show left time in play page
Diffstat (limited to 'backend/admin/handler.go')
| -rw-r--r-- | backend/admin/handler.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/backend/admin/handler.go b/backend/admin/handler.go index 5398107..41eacd4 100644 --- a/backend/admin/handler.go +++ b/backend/admin/handler.go @@ -229,16 +229,6 @@ func (h *Handler) postGameEdit(c echo.Context) error { } } - { - // TODO: - if state != row.State && state == "starting" { - err := h.hubs.StartGame(int(gameID)) - if err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, err.Error()) - } - } - } - err = h.q.UpdateGame(c.Request().Context(), db.UpdateGameParams{ GameID: int32(gameID), GameType: gameType, @@ -252,5 +242,15 @@ func (h *Handler) postGameEdit(c echo.Context) error { return echo.NewHTTPError(http.StatusInternalServerError, err.Error()) } + { + // TODO: + if state != row.State && state == "starting" { + err := h.hubs.StartGame(int(gameID)) + if err != nil { + return echo.NewHTTPError(http.StatusInternalServerError, err.Error()) + } + } + } + return c.Redirect(http.StatusSeeOther, c.Request().URL.Path) } |
