From 5d0ec9116f4e5ca2ee88d6a6ac098d39cfad6ac5 Mon Sep 17 00:00:00 2001 From: Weiko Date: Wed, 15 Jan 2025 11:26:39 +0100 Subject: [PATCH] Fix delete workspace-member avatar (#9630) ## Context avatarUrl is a TEXT field type so non nullable, which means if we try to run a mutation with null it will either fail or be ignored. Here this is the second option, done in sanitizeRecordInput where when a fieldMetadata has isNullable=false and the value is null, we return undefined. This caused the mutation to send an empty input and not remove the avatar --- .../settings/profile/components/ProfilePictureUploader.tsx | 2 +- .../twenty-front/src/modules/ui/input/components/ImageInput.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/twenty-front/src/modules/settings/profile/components/ProfilePictureUploader.tsx b/packages/twenty-front/src/modules/settings/profile/components/ProfilePictureUploader.tsx index 6d9bf03e00e2..cc29f7e58c5f 100644 --- a/packages/twenty-front/src/modules/settings/profile/components/ProfilePictureUploader.tsx +++ b/packages/twenty-front/src/modules/settings/profile/components/ProfilePictureUploader.tsx @@ -91,7 +91,7 @@ export const ProfilePictureUploader = () => { await updateOneRecord({ idToUpdate: currentWorkspaceMember?.id, updateOneRecordInput: { - avatarUrl: null, + avatarUrl: '', }, }); diff --git a/packages/twenty-front/src/modules/ui/input/components/ImageInput.tsx b/packages/twenty-front/src/modules/ui/input/components/ImageInput.tsx index e6cae6c5587a..e176e4592dac 100644 --- a/packages/twenty-front/src/modules/ui/input/components/ImageInput.tsx +++ b/packages/twenty-front/src/modules/ui/input/components/ImageInput.tsx @@ -172,7 +172,7 @@ export const ImageInput = ({ /> - We support your best PNGs, JPEGs and GIFs portraits under 10MB + We support your square PNGs, JPEGs and GIFs under 10MB {errorMessage && {errorMessage}}