Skip to content

Commit

Permalink
Merge pull request #720 from fabicsp/master
Browse files Browse the repository at this point in the history
Fix some type mismatch, if there are no links
  • Loading branch information
bashleigh committed Dec 13, 2022
2 parents b725592 + 38b2538 commit 1a2553c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/create-pagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ export function createPaginationObject<
currentPage: currentPage,
};

const links = route ? routes : undefined;

if (metaTransformer)
return new Pagination<T, CustomMetaType>(
items,
metaTransformer(meta),
route && routes,
links,
);

// @ts-ignore
return new Pagination<T, CustomMetaType>(items, meta, route && routes);
return new Pagination<T, CustomMetaType>(items, meta, links);
}

0 comments on commit 1a2553c

Please sign in to comment.