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
This commit is contained in:
@ -91,7 +91,7 @@ export const ProfilePictureUploader = () => {
|
|||||||
await updateOneRecord({
|
await updateOneRecord({
|
||||||
idToUpdate: currentWorkspaceMember?.id,
|
idToUpdate: currentWorkspaceMember?.id,
|
||||||
updateOneRecordInput: {
|
updateOneRecordInput: {
|
||||||
avatarUrl: null,
|
avatarUrl: '',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -172,7 +172,7 @@ export const ImageInput = ({
|
|||||||
/>
|
/>
|
||||||
</StyledButtonContainer>
|
</StyledButtonContainer>
|
||||||
<StyledText>
|
<StyledText>
|
||||||
We support your best PNGs, JPEGs and GIFs portraits under 10MB
|
We support your square PNGs, JPEGs and GIFs under 10MB
|
||||||
</StyledText>
|
</StyledText>
|
||||||
{errorMessage && <StyledErrorText>{errorMessage}</StyledErrorText>}
|
{errorMessage && <StyledErrorText>{errorMessage}</StyledErrorText>}
|
||||||
</StyledContent>
|
</StyledContent>
|
||||||
|
|||||||
Reference in New Issue
Block a user