4087 refactor object metadata item hooks and utils (#4861)

- Extracted each exported element from useObjectMetadataItem into its
own hook.
This commit is contained in:
Lucas Bordeau
2024-04-09 09:19:52 +02:00
committed by GitHub
parent 651af1c0e1
commit b1242bb850
89 changed files with 699 additions and 622 deletions
@@ -1,15 +1,15 @@
import { useCallback } from 'react';
import { useApolloClient } from '@apollo/client';
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
import { useGetRecordFromCache } from '@/object-record/cache/hooks/useGetRecordFromCache';
import { View } from '@/views/types/View';
export const useGetViewFromCache = () => {
const client = useApolloClient();
const cache = client.cache;
const { getRecordFromCache } = useObjectMetadataItem({
const getRecordFromCache = useGetRecordFromCache({
objectNameSingular: CoreObjectNameSingular.View,
});