Skip to content

Commit

Permalink
Allow specifying page_size without page for paginated endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
darthmaim committed Nov 1, 2024
1 parent 0147397 commit 83dfeed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/chilly-snakes-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@gw2api/types": patch
---

Allow specifying `page_size` without `page` for paginated endpoints
2 changes: 1 addition & 1 deletion packages/types/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ type WithParameters<Url extends string, Parameters extends string | undefined =
Parameters extends undefined ? Url : `${Url}?${Parameters}`;

// helper for paginated endpoints
type PaginationParameters = `page=${number}` | CombineParameters<`page=${number}`, `page_size=${number}`>;
type PaginationParameters = `page=${number}` | `page_size=${number}` | CombineParameters<`page=${number}`, `page_size=${number}`>;
type PaginatedEndpointUrl<Endpoint extends KnownEndpoint> = Endpoint | WithParameters<Endpoint, PaginationParameters>

// helper types for bulk requests
Expand Down

0 comments on commit 83dfeed

Please sign in to comment.