From b37d6f213c2f3b19631e5067f39a7106859faaed Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 12 Aug 2024 05:54:37 +0900 Subject: feat: show left time in play page --- backend/admin/handler.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'backend/admin/handler.go') 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) } -- cgit v1.2.3-70-g09d2