aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/api/handler.go
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-03-20 19:41:38 +0900
committernsfisis <nsfisis@gmail.com>2025-03-20 19:41:39 +0900
commit1a08d06be929900fb8d8b61a1ac0611005c277e8 (patch)
treeb064bfb79cc0021a42c423a04359504369e1faa5 /backend/api/handler.go
parent96081efcce7b7e1f4540cb74cb511a341f2cb4d3 (diff)
downloadphperkaigi-2025-albatross-1a08d06be929900fb8d8b61a1ac0611005c277e8.tar.gz
phperkaigi-2025-albatross-1a08d06be929900fb8d8b61a1ac0611005c277e8.tar.zst
phperkaigi-2025-albatross-1a08d06be929900fb8d8b61a1ac0611005c277e8.zip
feat: show submission date on ranking
Diffstat (limited to 'backend/api/handler.go')
-rw-r--r--backend/api/handler.go15
1 files changed, 8 insertions, 7 deletions
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{