JonathanGarro / SIMS-Portal

IFRC Surge Information Management Support Portal
4 stars 4 forks source link

Untag yourself as product collaborator #18

Closed JonathanGarro closed 1 year ago

JonathanGarro commented 1 year ago

Users can tag themselves as collaborators on products that have been posted to the portal, but there currently isn't a way to untag yourself. The route to assign yourself currently:

A route to remove an ID from that list would need to run a similar validation, then run remove() on the list.

JonathanGarro commented 1 year ago

I've added a remove_supporter_from_product route and adjusted the view so that users can both tag and remove themselves. There was an error that this route introduced when removing someone, as the product page does validation on whether the collaborator_ids column is None. So I added a conditional that inserts 0 into the column if removing a user leaves the column blank.