[bug]: using API to PATCH
issue labels causes the label to be **repeated** in API response
#5997
Open
1 task done
Labels
🐛bug
Something isn't working
Is there an existing issue for this?
Current behavior
When I use the API to PATCH an Issue's Labels, there are 2 issues:
SCENARIO 1. If we PATCH an existing label i.e. an already assigned label, the label is repeated in the DB/Response though the UI only shows unique labels. I would expect the label to not be repeated in the DB.
SCENARIO 2. Sending empty array of labels does NOT remove the labels from the API response though it DOES from the UI. I would expect empty array to remove all the labels even from response.
It seems like the UI is using a
label_ids
field which is different from thelabels
field returned by API.Steps to reproduce
curl pseudo
GET https://api.plane.so/api/v1/workspaces/<SLUG>/projects/<PROJECT>/issues/<ISSUES>/?fields=labels
response:
THEN again:
GET https://api.plane.so/api/v1/workspaces/<SLUG>/projects/<PROJECT>/issues/<ISSUES>/?fields=labels
response:
NOTICE there are now FOUR of the PATCHed ID.
Videos
ONE: PATCH new label - this video shows that I add a new label using API which is reflected on the UI but the labels in API get the label APPENDED.
plane-patch-new-label.mp4
TWO: PATCH empty - this video shows that I set labels to empty which a-OK in the UI but the API response still has the labels.
plane-patch-empty.mp4
Environment
Production
Browser
None
Variant
Cloud
Version
Cloud?
The text was updated successfully, but these errors were encountered: