You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
createProjectLabel returns just the newly created label but createProjectTag returns all tags in the project. updateProject[Label/Tag} behaves the same way. deleteProjectLabel returns StandardPayload, but deleteTag returns all project.tags. We should pick one approach and make it uniform. Will require some updates to the handling on the frontend in both projectsSlice.js and filtersSlice.js.
Note: in the case of deleting Tags and Labels, it doesn't technically matter what we return because we immediately clear images and fetch for the fresh project after successful deletions. But that's a frontend-specific implementation detail, so I think it's probably best to return the updated list of project.tags and labels even if we aren't using them at them moment.
I made the create and update payloads the same for Labels and Tags, but I held off on making the deleteProjectTags and deleteProjectLabels payloads consistent for now because it seems like the new implementation of deleteLabel utilizes the isOk part of the payload in a few places and I'm not totally tracking what it's for. It seems like isOk: false only can happen if the bulkWrite(operations) returns a bad response in ImageModel.deleteLabelsFromImages():
But if we get a bad response from the DB there, I assume it will throw an error and the res.isOk() check would get skipped? If so maybe we don't need the isOk part of the payload and we can make the deletes more uniform. Should probably check with @lessej first.
createProjectLabel
returns just the newly createdlabel
butcreateProjectTag
returns alltags
in the project.updateProject[Label/Tag}
behaves the same way.deleteProjectLabel
returnsStandardPayload
, butdeleteTag
returns allproject.tags
. We should pick one approach and make it uniform. Will require some updates to the handling on the frontend in bothprojectsSlice.js
andfiltersSlice.js
.Note: in the case of deleting Tags and Labels, it doesn't technically matter what we return because we immediately clear images and fetch for the fresh project after successful deletions. But that's a frontend-specific implementation detail, so I think it's probably best to return the updated list of
project.tags
andlabels
even if we aren't using them at them moment.Related: #293
The text was updated successfully, but these errors were encountered: