From 1a08d06be929900fb8d8b61a1ac0611005c277e8 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 20 Mar 2025 19:41:38 +0900 Subject: feat: show submission date on ranking --- backend/api/handler.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'backend/api/handler.go') diff --git a/backend/api/handler.go b/backend/api/handler.go index 4514a25..2cb04c5 100644 --- a/backend/api/handler.go +++ b/backend/api/handler.go @@ -252,14 +252,15 @@ func (h *Handler) GetGameWatchRanking(ctx context.Context, request GetGameWatchR for i, row := range rows { ranking[i] = RankingEntry{ Player: User{ - UserID: int(row.UserID), - Username: row.Username, - DisplayName: row.DisplayName, - IconPath: row.IconPath, - IsAdmin: row.IsAdmin, - Label: toNullable(row.Label), + UserID: int(row.User.UserID), + Username: row.User.Username, + DisplayName: row.User.DisplayName, + IconPath: row.User.IconPath, + IsAdmin: row.User.IsAdmin, + Label: toNullable(row.User.Label), }, - Score: int(row.CodeSize), + Score: int(row.Submission.CodeSize), + SubmittedAt: row.Submission.CreatedAt.Time.Unix(), } } return GetGameWatchRanking200JSONResponse{ -- cgit v1.2.3-70-g09d2