Skip to content

Commit

Permalink
Merge branch 'pagination-url'
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalrymple committed Jun 12, 2019
2 parents 688c1f2 + 2b290b5 commit 4614a49
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/infrastructure/RequestHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ export async function get(
// Rescurse through pagination results
if (!query.page && underLimit && pagination.next) {
const { next } = Li.parse(headers.link);
const more = await get(service, next.replace(`${service.url}/`, ''), {
const leaf = service.url.split('/').pop() || ""
const regex = new RegExp(`.+\/api\/v\d(\/${leaf})?\/`)
const more = await get(service, next.replace(regex, ''), {
maxPages,
sudo,
showPagination: true
Expand Down

0 comments on commit 4614a49

Please sign in to comment.