aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/api/handler.go
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-08-12 05:54:37 +0900
committernsfisis <nsfisis@gmail.com>2024-08-12 05:54:37 +0900
commitb37d6f213c2f3b19631e5067f39a7106859faaed (patch)
tree3c45267ee25aa78be1ad4c31e0c09894e656b506 /backend/api/handler.go
parent545d86085f927bded852dd5a8ee8341f60f24d84 (diff)
downloadiosdc-japan-2024-albatross-b37d6f213c2f3b19631e5067f39a7106859faaed.tar.gz
iosdc-japan-2024-albatross-b37d6f213c2f3b19631e5067f39a7106859faaed.tar.zst
iosdc-japan-2024-albatross-b37d6f213c2f3b19631e5067f39a7106859faaed.zip
feat: show left time in play page
Diffstat (limited to 'backend/api/handler.go')
-rw-r--r--backend/api/handler.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/backend/api/handler.go b/backend/api/handler.go
index eca6006..a0ecd4c 100644
--- a/backend/api/handler.go
+++ b/backend/api/handler.go
@@ -84,9 +84,9 @@ func (h *Handler) GetGames(ctx context.Context, _ GetGamesRequestObject, user *a
}
games := make([]Game, len(gameRows))
for i, row := range gameRows {
- var startedAt *int
+ var startedAt *int64
if row.StartedAt.Valid {
- startedAtTimestamp := int(row.StartedAt.Time.Unix())
+ startedAtTimestamp := row.StartedAt.Time.Unix()
startedAt = &startedAtTimestamp
}
games[i] = Game{
@@ -123,9 +123,9 @@ func (h *Handler) GetGame(ctx context.Context, request GetGameRequestObject, use
}
return nil, echo.NewHTTPError(http.StatusInternalServerError, err.Error())
}
- var startedAt *int
+ var startedAt *int64
if row.StartedAt.Valid {
- startedAtTimestamp := int(row.StartedAt.Time.Unix())
+ startedAtTimestamp := row.StartedAt.Time.Unix()
startedAt = &startedAtTimestamp
}
playerRows, err := h.q.ListGamePlayers(ctx, int32(gameID))