fix(paginator): last page now correctly matches rex
This commit is contained in:
parent
884fc90171
commit
dcf9898d67
@ -37,8 +37,7 @@ export function getNextPage(links: PaginationLink[]): string | null {
|
||||
const last = links.find((l) => l.rel === 'last');
|
||||
if (!next || !last) return null;
|
||||
const matchNext = next.uri.match(/page=([0-9]*)/);
|
||||
const matchLast = next.uri.match(/page=([0-9]*)/);
|
||||
|
||||
const matchLast = last.uri.match(/page=([0-9]*)/);
|
||||
if (!matchNext || !matchLast) return null;
|
||||
if (matchNext[1] === matchLast[1]) return null;
|
||||
return matchNext[1];
|
||||
|
Loading…
x
Reference in New Issue
Block a user