Skip to content

Commit

Permalink
Add missing user_ids param from swagger group demote (heroiclabs#450)
Browse files Browse the repository at this point in the history
Make user_ids param required on group demote api
  • Loading branch information
sesposito authored Aug 10, 2020
1 parent 85a285c commit cb8fb91
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions apigrpc/apigrpc.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1748,6 +1748,16 @@
"in": "path",
"required": true,
"type": "string"
},
{
"name": "user_ids",
"description": "The users to demote.",
"in": "query",
"required": true,
"type": "array",
"items": {
"type": "string"
}
}
],
"tags": [
Expand Down
2 changes: 1 addition & 1 deletion server/api_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ func (s *ApiServer) DemoteGroupUsers(ctx context.Context, in *api.DemoteGroupUse
}

if len(in.GetUserIds()) == 0 {
return &empty.Empty{}, nil
return nil, status.Error(codes.InvalidArgument, "User IDs must be set.")
}

userIDs := make([]uuid.UUID, 0, len(in.GetUserIds()))
Expand Down

0 comments on commit cb8fb91

Please sign in to comment.