Skip to content

Commit

Permalink
added a check on player batch for no more than 20
Browse files Browse the repository at this point in the history
  • Loading branch information
bshore committed Apr 12, 2021
1 parent 972241f commit db9b935
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hirezapi/paladins.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import (

// GetPlayerBatch returns league and other high level data for a particular list of players. [20 max]
func (a *APIClient) GetPlayerBatch(playerIDs []string) ([]models.Player, error) {
if len(playerIDs) > 20 {
return nil, fmt.Errorf("per API docs, the list of playerIDs should contain no more than 20")
}
if !IsPaladinsPath(a.BasePath) {
return nil, fmt.Errorf("GetPlayerBatch() %s", notPaladinsErrMsg)
}
Expand Down

0 comments on commit db9b935

Please sign in to comment.