This commit is contained in:
2026-10-02 23:19:44 +07:00
parent b1fb9c4dfa
commit b97a5bc0cd
3 changed files with 14 additions and 5 deletions
+3 -4
View File
@@ -7,8 +7,7 @@ import (
"evening_detective_server/internal/modules/processor_jwt"
"evening_detective_server/internal/modules/roles"
"evening_detective_server/internal/modules/team_qr_pdf"
"evening_detective_server/internal/repos/games_repo"
"evening_detective_server/internal/services/team_service"
"evening_detective_server/proto"
"google.golang.org/genproto/googleapis/api/httpbody"
@@ -32,9 +31,9 @@ func (s *server) DownloadTeamQR(ctx context.Context, req *proto.GetGameReq) (*ht
data, filename, err := s.teamService.DownloadTeamQR(ctx, int(req.ID))
if err != nil {
switch {
case errors.Is(err, games_repo.ErrGameNotFound):
case errors.Is(err, team_service.ErrGameNotFound):
return nil, status.Error(codes.NotFound, err.Error())
case errors.Is(err, team_qr_pdf.ErrNoCards):
case errors.Is(err, team_service.ErrNoCards):
return nil, status.Error(codes.FailedPrecondition, err.Error())
default:
return nil, status.Error(codes.Internal, err.Error())