mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-28 23:03:41 +03:00
Favorites should be user-level not workspace-level (#5186)
### Description Favorites should be user-level not workspace-level ### Refs #3374 ### Demo https://github.com/twentyhq/twenty/assets/140154534/38a34cc7-ac58-494f-92d5-e15c43ae542e Fixes #3374 --------- Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com> Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
parent
bc0d30f28b
commit
9ad68ffe84
@ -37,6 +37,11 @@ export const useFavorites = () => {
|
||||
|
||||
const { records: favorites } = usePrefetchedData<Favorite>(
|
||||
PrefetchKey.AllFavorites,
|
||||
{
|
||||
workspaceMemberId: {
|
||||
eq: currentWorkspaceMember?.id ?? '',
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
const favoriteRelationFieldMetadataItems = useMemo(
|
||||
|
@ -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 = <T extends ObjectRecord>(
|
||||
prefetchKey: PrefetchKey,
|
||||
filter?: RecordGqlOperationFilter,
|
||||
) => {
|
||||
const isDataPrefetched = useRecoilValue(
|
||||
prefetchIsLoadedFamilyState(prefetchKey),
|
||||
@ -29,6 +31,7 @@ export const usePrefetchedData = <T extends ObjectRecord>(
|
||||
generateDepthOneRecordGqlFields({
|
||||
objectMetadataItem,
|
||||
}),
|
||||
filter,
|
||||
});
|
||||
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user