Skip to content

Commit

Permalink
Better handling of undefined query page
Browse files Browse the repository at this point in the history
  • Loading branch information
Anahkiasen committed Sep 7, 2023
1 parent 343ecd1 commit d8a21e1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pages/dashboard/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,9 @@ const getServerSideProps = getApplicationServerSideProps(
await Promise.all(
Object.entries(UseGetItemsByCreatorMap).map(([key, hook]) => {
const page =
query.tab === key ? parseInt((query.page as string) ?? '1') : 1;
query.tab === key && query.page
? parseInt((query.page as string) ?? '1')
: 1;

const sort = query?.sort as string | undefined;
const sortingField = sort?.split('_')[0] ?? SortingField.CREATED;
Expand Down

0 comments on commit d8a21e1

Please sign in to comment.