Skip to content

Commit

Permalink
Add an error for the thing api to limit it to 20
Browse files Browse the repository at this point in the history
  • Loading branch information
fzerorubigd committed Nov 18, 2024
1 parent a119e7b commit 5b9814c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions thing.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ func (bgg *BGG) GetThings(ctx context.Context, setters ...GetOptionSetter) ([]Th
return nil, errors.New("at least one id is required")
}

if len(opt.ids) > 20 {
return nil, errors.New("BGG limits the number of item in one call to 20 items")
}

args := map[string]string{
"id": strings.Join(opt.ids, ","),
"stats": "1",
Expand Down

0 comments on commit 5b9814c

Please sign in to comment.