Skip to content

Commit

Permalink
Fix delete workspace-member avatar (#9630)
Browse files Browse the repository at this point in the history
## 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
  • Loading branch information
Weiko authored Jan 15, 2025
1 parent fc484bd commit 5d0ec91
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const ProfilePictureUploader = () => {
await updateOneRecord({
idToUpdate: currentWorkspaceMember?.id,
updateOneRecordInput: {
avatarUrl: null,
avatarUrl: '',
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export const ImageInput = ({
/>
</StyledButtonContainer>
<StyledText>
We support your best PNGs, JPEGs and GIFs portraits under 10MB
We support your square PNGs, JPEGs and GIFs under 10MB
</StyledText>
{errorMessage && <StyledErrorText>{errorMessage}</StyledErrorText>}
</StyledContent>
Expand Down

0 comments on commit 5d0ec91

Please sign in to comment.