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.
1 parent 0f32ec5 commit fa39e0dCopy full SHA for fa39e0d
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
@@ -65,7 +65,7 @@ class Pagination {
65
pageNumber(response, pageName) {
66
try {
67
return response.result['meta']['links'][pageName]
68
- .split('page%5Boffset%5D=')[1].split('&')[0]
+ .split('page%5Boffset%5D=')[1]?.split('&')[0] || null;
69
} catch (TypeError) {
70
return null;
71
0 commit comments