From fbdf5a7c82e12eb6f907e3fbe3079a271ec843d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=82=8F=E3=81=8D=E3=82=93?= Date: Thu, 8 Aug 2024 17:02:00 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B9=E3=82=B3=E3=82=A2=E3=81=8C=E7=99=BB?= =?UTF-8?q?=E9=8C=B2=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84=E3=81=AA=E3=81=84?= =?UTF-8?q?=E6=99=82=E3=81=AB=E7=A9=BA=E3=81=AE=E9=85=8D=E5=88=97=E3=82=92?= =?UTF-8?q?=E8=BF=94=E3=81=99=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typing-server/api/repository/score.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/typing-server/api/repository/score.go b/typing-server/api/repository/score.go index a62292d7..f9729c14 100644 --- a/typing-server/api/repository/score.go +++ b/typing-server/api/repository/score.go @@ -45,9 +45,13 @@ func GetScoresRanking(ctx context.Context, client *ent.Client, request *model.Ge All(ctx) if err != nil { - if !ent.IsNotFound(err) { - return nil, err + if ent.IsNotFound(err) { + return &model.GetScoresRankingResponse{ + Rankings: make([]*model.ScoreRanking, 0), + TotalCount: 0, + }, nil } + return nil, err } rankings := make([]*model.ScoreRanking, 0, len(scores))