Skip to content

Commit

Permalink
Removed unused cursor by record id logic
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasbordeau committed Jul 19, 2024
1 parent ded2bd7 commit 7f37933
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 33 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { getQueryIdentifier } from '@/object-record/utils/getQueryIdentifier';
import { isDefined } from '~/utils/isDefined';
import { capitalize } from '~/utils/string/capitalize';

import { getCursorByRecordIdFromRecordConnection } from '@/object-record/cache/utils/getCursorByRecordIdFromRecordConnection';
import { cursorFamilyState } from '../states/cursorFamilyState';
import { hasNextPageFamilyState } from '../states/hasNextPageFamilyState';
import { isFetchingMoreRecordsFamilyState } from '../states/isFetchingMoreRecordsFamilyState';
Expand Down Expand Up @@ -222,19 +221,10 @@ export const useFetchMoreRecordsWithPagination = <
[recordConnection],
);

const cursorsByRecordId = useMemo(
() =>
getCursorByRecordIdFromRecordConnection({
recordConnection,
}),
[recordConnection],
);

return {
fetchMoreRecords,
totalCount,
records,
hasNextPage,
cursorsByRecordId,
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const useFindManyRecords = <T extends ObjectRecord = ObjectRecord>({
onError: handleFindManyRecordsError,
});

const { fetchMoreRecords, records, hasNextPage, cursorsByRecordId } =
const { fetchMoreRecords, records, hasNextPage } =
useFetchMoreRecordsWithPagination<T>({
objectNameSingular,
filter,
Expand All @@ -103,6 +103,5 @@ export const useFindManyRecords = <T extends ObjectRecord = ObjectRecord>({
queryStateIdentifier: queryIdentifier,
hasNextPage,
pageInfo,
cursorsByRecordId,
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export const useLoadRecordIndexTable = (objectNameSingular: string) => {
totalCount,
fetchMoreRecords,
queryStateIdentifier,
cursorsByRecordId,
} = useFindManyRecords({
...params,
recordGqlFields,
Expand All @@ -74,6 +73,5 @@ export const useLoadRecordIndexTable = (objectNameSingular: string) => {
fetchMoreRecords,
queryStateIdentifier,
setRecordTableData,
cursorsByRecordId,
};
};

0 comments on commit 7f37933

Please sign in to comment.