Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasbordeau committed Jul 18, 2024
1 parent eb0edcd commit ded2bd7
Showing 1 changed file with 0 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export const useRecordShowPagePagination = (
const {
loading: loadingRecordBefore,
records: recordsBefore,
pageInfo: pageInfoBefore,
totalCount: totalCountBefore,
} = useFindManyRecords({
filter,
Expand All @@ -71,7 +70,6 @@ export const useRecordShowPagePagination = (
const {
loading: loadingRecordAfter,
records: recordsAfter,
pageInfo: pageInfoAfter,
totalCount: totalCountAfter,
} = useFindManyRecords({
filter,
Expand All @@ -97,28 +95,15 @@ export const useRecordShowPagePagination = (
const recordBefore = recordsBefore[0];
const recordAfter = recordsAfter[0];

const recordBeforeCursor = pageInfoBefore?.endCursor;
const recordAfterCursor = pageInfoAfter?.endCursor;

const navigateToPreviousRecord = () => {
navigate(
buildShowPageURL(objectNameSingular, recordBefore.id, viewIdQueryParam),
{
state: {
cursor: recordBeforeCursor,
},
},
);
};

const navigateToNextRecord = () => {
navigate(
buildShowPageURL(objectNameSingular, recordAfter.id, viewIdQueryParam),
{
state: {
cursor: recordAfterCursor,
},
},
);
};

Expand Down

0 comments on commit ded2bd7

Please sign in to comment.