Handle case where fieldValue is null (#8210)

Allow null values when updating relation to fix detach action
This commit is contained in:
martmull 2024-10-30 16:53:02 +01:00 committed by GitHub
parent 7b467822f1
commit 7f90ac2df8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -37,7 +37,7 @@ export const sanitizeRecordInput = ({
(field) => field.name === relationIdFieldName,
);
return relationIdFieldMetadataItem && fieldValue?.id
return relationIdFieldMetadataItem
? [relationIdFieldName, fieldValue?.id ?? null]
: undefined;
}