Skip to content

Commit

Permalink
fix: Remove document qualification should refresh UI
Browse files Browse the repository at this point in the history
In the case where we remove the qualification it's necessary
to define the attribute to `null` and not `undefined`,
with `undefined` the stack does not return the attribute
and today the Redux store is not updated for a missing attribute.

As a result, the UI is not updated and continues to
display the qualification on the document,
even though it has been deleted in CouchDB.
  • Loading branch information
Merkur39 committed Apr 12, 2024
1 parent dd437ab commit c568e80
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/modules/views/Modal/QualifyFileView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,12 @@ export const QualifyFileView = () => {
return onClose()
}

/*
In the case where we remove the qualification it's necessary to define the attribute to `null` and not `undefined`, with `undefined` the stack does not return the attribute and today the Redux store is not updated for a missing attribute.
As a result, the UI is not updated and continues to display the qualification on the document, even though it has been deleted in CouchDB.
*/
await fileCollection.updateMetadataAttribute(file._id, {
qualification: removeQualification ? undefined : item
qualification: removeQualification ? null : item
})
onClose()
}
Expand Down

0 comments on commit c568e80

Please sign in to comment.