From 685808c69d7459834775c75dbe5279f062fb78b6 Mon Sep 17 00:00:00 2001 From: Weiko Date: Fri, 14 Mar 2025 13:45:34 +0100 Subject: [PATCH] Fix activity target creation (#10885) ## Context Delete was using the wrong id Create was not setting the morph id --- .../inline-cell/hooks/useUpdateActivityTargetFromInlineCell.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/twenty-front/src/modules/activities/inline-cell/hooks/useUpdateActivityTargetFromInlineCell.ts b/packages/twenty-front/src/modules/activities/inline-cell/hooks/useUpdateActivityTargetFromInlineCell.ts index 1ae590bc3..d96caaffc 100644 --- a/packages/twenty-front/src/modules/activities/inline-cell/hooks/useUpdateActivityTargetFromInlineCell.ts +++ b/packages/twenty-front/src/modules/activities/inline-cell/hooks/useUpdateActivityTargetFromInlineCell.ts @@ -88,7 +88,7 @@ export const useUpdateActivityTargetFromInlineCell = ({ if (!morphItem.isSelected) { await deleteOneActivityTarget( - existingActivityTarget.targetObject.id, + existingActivityTarget.activityTarget.id, ); } } else { @@ -146,6 +146,7 @@ export const useUpdateActivityTargetFromInlineCell = ({ ...activityTarget, [targetObjectName]: undefined, [pickedObjectMetadataItem.nameSingular]: undefined, + [`${pickedObjectMetadataItem.nameSingular}Id`]: morphItem.recordId, } as Partial); }