Skip to content

Commit

Permalink
feat(go): admin season stats route verify if input is not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
MikaelVallenet committed Apr 5, 2023
1 parent ee5fc79 commit 829757e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions go/cmd/pathwar/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -822,8 +822,8 @@ func adminSeasonStats() *ffcli.Command {
}

if datetime == "" {
input := &pwapi.AdminSeasonStats_Input{SeasonID: season}
ret, err := apiClient.AdminSeasonStats(ctx, input)
input := pwapi.AdminSeasonStats_Input{SeasonID: season}
ret, err := apiClient.AdminSeasonStats(ctx, &input)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion go/pkg/pwapi/api_admin-season-stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func (svc *service) AdminSeasonStats(ctx context.Context, in *AdminSeasonStats_I
if !isAdminContext(ctx) {
return nil, errcode.ErrRestrictedArea
}
if in == nil {
if in == nil || in.SeasonID == "" {
return nil, errcode.ErrMissingInput
}

Expand Down

0 comments on commit 829757e

Please sign in to comment.