fix IndexFieldMetadata availability in IndexMetadata/ObjectMetadata in front (#12886)
Context : - IndexFieldMetadata was no longer available on 'objects' gql query ([since this PR](https://github.com/twentyhq/twenty/pull/12785)). Then, unicity checks on import do not work anymore. Fix : - Add a dataloader logic in indexFieldMetadata - Add extra check in unicity hook on import
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import { IndexFieldMetadataItem } from '@/object-metadata/types/IndexFieldMetadataItem';
|
||||
import { IndexMetadataItem } from '@/object-metadata/types/IndexMetadataItem';
|
||||
import { objectMetadataItemSchema } from '@/object-metadata/validation-schemas/objectMetadataItemSchema';
|
||||
import { ObjectMetadataItemsQuery } from '~/generated-metadata/graphql';
|
||||
@ -26,7 +27,12 @@ export const mapPaginatedObjectMetadataItemsToObjectMetadataItems = ({
|
||||
(index) =>
|
||||
({
|
||||
...index,
|
||||
indexFieldMetadatas: [],
|
||||
indexFieldMetadatas: index.indexFieldMetadataList.map(
|
||||
(indexFieldMetadata) =>
|
||||
({
|
||||
...indexFieldMetadata,
|
||||
}) satisfies IndexFieldMetadataItem,
|
||||
),
|
||||
}) satisfies IndexMetadataItem,
|
||||
),
|
||||
} satisfies ObjectMetadataItem;
|
||||
|
||||
Reference in New Issue
Block a user