diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-03-21 02:11:49 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-03-21 02:11:49 +0900 |
| commit | a51f7aefb2f6a247a57f01d3ca5acc300451bba2 (patch) | |
| tree | cdf2d96f43db3b54e55a9cd705dfd343cb65ade8 | |
| parent | 4acf8d51b257c30b1a5dd99bd515ac22ddd5b564 (diff) | |
| download | phperkaigi-2025-albatross-a51f7aefb2f6a247a57f01d3ca5acc300451bba2.tar.gz phperkaigi-2025-albatross-a51f7aefb2f6a247a57f01d3ca5acc300451bba2.tar.zst phperkaigi-2025-albatross-a51f7aefb2f6a247a57f01d3ca5acc300451bba2.zip | |
fix(backend): fix various admin features
| -rw-r--r-- | backend/admin/handler.go | 3 | ||||
| -rw-r--r-- | backend/admin/templates/user_edit.html | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/backend/admin/handler.go b/backend/admin/handler.go index c0ddd43..123e6f4 100644 --- a/backend/admin/handler.go +++ b/backend/admin/handler.go @@ -320,6 +320,7 @@ func (h *Handler) postGameEdit(c echo.Context) error { } } + // TODO: transaction err = h.q.UpdateGame(c.Request().Context(), db.UpdateGameParams{ GameID: int32(gameID), GameType: gameType, @@ -374,7 +375,7 @@ func (h *Handler) postGameStart(c echo.Context) error { return echo.NewHTTPError(http.StatusBadRequest, "Invalid game id") } - startedAt := time.Now().Add(11 * time.Second) + startedAt := time.Now().Add(10 * time.Second) err = h.q.UpdateGameStartedAt(c.Request().Context(), db.UpdateGameStartedAtParams{ GameID: int32(gameID), diff --git a/backend/admin/templates/user_edit.html b/backend/admin/templates/user_edit.html index 54b823b..6942204 100644 --- a/backend/admin/templates/user_edit.html +++ b/backend/admin/templates/user_edit.html @@ -20,7 +20,7 @@ </div> <div> <label>Icon Path</label> - <input type="text" name="icon_path" value="{{ .User.IconPath }}"> + <input type="text" name="icon_path" value="{{ if .User.IconPath }}{{ .User.IconPath }}{{ end }}"> </div> <div> <label>Is Admin</label> @@ -28,7 +28,7 @@ </div> <div> <label>Label</label> - <input type="text" name="label" value="{{ .User.Label }}"> + <input type="text" name="label" value="{{ if .User.Label }}{{ .User.Label }}{{ end }}"> </div> <div> <button type="submit">Save</button> |
