mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-25 16:04:01 +00:00
Fix the parsing of pagination link querystrings (#2366)
This commit is contained in:
parent
531758c6db
commit
a70b66a467
@ -119,7 +119,9 @@ async function getHelper<P extends 'keyset' | 'offset', E extends boolean>(
|
||||
// Handle array responses
|
||||
const newAcc = [...acc, ...body];
|
||||
const { next }: { next: string } = parseLink(headers.link);
|
||||
const { query: qs = {} } = next ? parseQueryString(next, { parseNumbers: true }) : {};
|
||||
const { query: qs = {} } = next
|
||||
? parseQueryString(next, { parseNumbers: true, arrayFormat: 'bracket' })
|
||||
: {};
|
||||
const withinBounds = maxPages
|
||||
? newAcc.length / ((qs.per_page as unknown as number) || 20) < maxPages
|
||||
: true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user