diff --git a/packages/twenty-front/src/modules/object-metadata/utils/getObjectMetadataItemsMock.ts b/packages/twenty-front/src/modules/object-metadata/utils/getObjectMetadataItemsMock.ts index c50755a51f..4c004f8696 100644 --- a/packages/twenty-front/src/modules/object-metadata/utils/getObjectMetadataItemsMock.ts +++ b/packages/twenty-front/src/modules/object-metadata/utils/getObjectMetadataItemsMock.ts @@ -3155,6 +3155,14 @@ export const getObjectMetadataItemsMock = () => { }, toFieldMetadataId: '20202020-64e1-4080-b6ad-db03c3809885', }, + relationDefinition: { + targetObjectMetadata: { + nameSingular: 'person', + }, + targetFieldMetadata: { + name: 'company', + }, + }, toRelationMetadata: null, }, { diff --git a/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/RelationFromManyFieldInputMultiRecordsEffect.tsx b/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/RelationFromManyFieldInputMultiRecordsEffect.tsx index 060576f161..6f42a7fbad 100644 --- a/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/RelationFromManyFieldInputMultiRecordsEffect.tsx +++ b/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/RelationFromManyFieldInputMultiRecordsEffect.tsx @@ -112,7 +112,9 @@ export const RelationFromManyFieldInputMultiRecordsEffect = () => { useEffect(() => { setObjectRecordMultiSelectCheckedRecordsIds( - fieldValue.map((fieldValueItem: EntityForSelect) => fieldValueItem.id), + fieldValue + ? fieldValue.map((fieldValueItem: EntityForSelect) => fieldValueItem.id) + : [], ); }, [fieldValue, setObjectRecordMultiSelectCheckedRecordsIds]); diff --git a/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/__stories__/RelationManyFieldInput.stories.tsx b/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/__stories__/RelationManyFieldInput.stories.tsx index 04ee477448..a02b1ffb38 100644 --- a/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/__stories__/RelationManyFieldInput.stories.tsx +++ b/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/__stories__/RelationManyFieldInput.stories.tsx @@ -45,15 +45,14 @@ const RelationManyFieldInputWithContext = () => {