We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 386f0ca + 16ddea8 commit 7d81194Copy full SHA for 7d81194
spec/amadeus/client/pagination.test.js
@@ -24,7 +24,7 @@ describe('Pagination', () => {
24
result: {
25
meta: {
26
links: {
27
- next: 'https://example.com?page=2'
+ next: 'https://example.com?page%5Boffset%5D=2'
28
}
29
30
src/amadeus/client/pagination.js
@@ -64,7 +64,8 @@ class Pagination {
64
*/
65
pageNumber(response, pageName) {
66
try {
67
- return response.result['meta']['links'][pageName].split('=').pop();
+ return response.result['meta']['links'][pageName]
68
+ .split('page%5Boffset%5D=')[1].split('&')[0];
69
} catch (TypeError) {
70
return null;
71
0 commit comments