From a2a612648a58e62537927a40bb9a00ef0c296db9 Mon Sep 17 00:00:00 2001 From: Justin Date: Tue, 11 Jun 2019 12:55:09 -0400 Subject: [PATCH 1/3] fix: Wrong endpoint being passed during pagination fixes: #344 --- src/infrastructure/RequestHelper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/infrastructure/RequestHelper.ts b/src/infrastructure/RequestHelper.ts index 740dd882..8477c0df 100644 --- a/src/infrastructure/RequestHelper.ts +++ b/src/infrastructure/RequestHelper.ts @@ -31,7 +31,7 @@ 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(/.+\/api\/v\d\//, ''), { + const more = await get(service, next.replace(service.url, ''), { maxPages, sudo, showPagination: true From 38d50dc6e8b3d4ee91888bdb6489bed5f7d145dc Mon Sep 17 00:00:00 2001 From: Justin Date: Tue, 11 Jun 2019 13:05:08 -0400 Subject: [PATCH 2/3] Add trailing slash to replace function --- src/infrastructure/RequestHelper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/infrastructure/RequestHelper.ts b/src/infrastructure/RequestHelper.ts index 8477c0df..9ba3120c 100644 --- a/src/infrastructure/RequestHelper.ts +++ b/src/infrastructure/RequestHelper.ts @@ -31,7 +31,7 @@ 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 more = await get(service, next.replace(service.url + '/', ''), { maxPages, sudo, showPagination: true From 45f963c82dfa7a76fadebb0c769541ea02d593dc Mon Sep 17 00:00:00 2001 From: Justin Date: Tue, 11 Jun 2019 13:45:44 -0400 Subject: [PATCH 3/3] Fixing some styling problems --- src/infrastructure/RequestHelper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/infrastructure/RequestHelper.ts b/src/infrastructure/RequestHelper.ts index 9ba3120c..10628c3f 100644 --- a/src/infrastructure/RequestHelper.ts +++ b/src/infrastructure/RequestHelper.ts @@ -31,7 +31,7 @@ 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 more = await get(service, next.replace(`${service.url}/`, ''), { maxPages, sudo, showPagination: true