diff --git a/packages/twenty-front/src/modules/favorites/hooks/useFavorites.ts b/packages/twenty-front/src/modules/favorites/hooks/useFavorites.ts index f01cdd1d4f..802aa3a3de 100644 --- a/packages/twenty-front/src/modules/favorites/hooks/useFavorites.ts +++ b/packages/twenty-front/src/modules/favorites/hooks/useFavorites.ts @@ -37,6 +37,11 @@ export const useFavorites = () => { const { records: favorites } = usePrefetchedData( PrefetchKey.AllFavorites, + { + workspaceMemberId: { + eq: currentWorkspaceMember?.id ?? '', + }, + }, ); const favoriteRelationFieldMetadataItems = useMemo( diff --git a/packages/twenty-front/src/modules/prefetch/hooks/usePrefetchedData.ts b/packages/twenty-front/src/modules/prefetch/hooks/usePrefetchedData.ts index eafac6366b..5db8f0d071 100644 --- a/packages/twenty-front/src/modules/prefetch/hooks/usePrefetchedData.ts +++ b/packages/twenty-front/src/modules/prefetch/hooks/usePrefetchedData.ts @@ -1,6 +1,7 @@ import { useRecoilValue } from 'recoil'; import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem'; +import { RecordGqlOperationFilter } from '@/object-record/graphql/types/RecordGqlOperationFilter'; import { generateDepthOneRecordGqlFields } from '@/object-record/graphql/utils/generateDepthOneRecordGqlFields'; import { useFindManyRecords } from '@/object-record/hooks/useFindManyRecords'; import { ObjectRecord } from '@/object-record/types/ObjectRecord'; @@ -10,6 +11,7 @@ import { PrefetchKey } from '@/prefetch/types/PrefetchKey'; export const usePrefetchedData = ( prefetchKey: PrefetchKey, + filter?: RecordGqlOperationFilter, ) => { const isDataPrefetched = useRecoilValue( prefetchIsLoadedFamilyState(prefetchKey), @@ -29,6 +31,7 @@ export const usePrefetchedData = ( generateDepthOneRecordGqlFields({ objectMetadataItem, }), + filter, }); return {