Mentorship-backend: Update endpoint for task checking to be a simple update method

Created on 7 Dec 2019  路  9Comments  路  Source: anitab-org/mentorship-backend

Is your feature request related to a problem? Please describe.
My feature is related to the unability to "uncheck/unmark" task that was once marked as completed.

Describe the solution you'd like
I'd like an endpoint like /mentorship_relation/{request_id}/task/{task_id}/uncomplete to be added. I'm also willing to work on it.

Describe alternatives you've considered
Alternative solution would be to change the implementation on the Android side. In my opinion, checkboxes are a bit misleading for a user, as they imply that a task can be "unchecked". Example of such a confusing behavior below:

demo

Coding Available Enhancement

All 9 comments

@bartekpacia thank you for reporting this issue 馃帀
I have a doubt, do you think the api should be:

PUT /mentorship_relation/{request_id}/task/{task_id}/uncomplete

instead of:

PUT /mentorship_relation/{request_id}/task/{task_id}/

that receives a request body as:

{
   "complete": true
}

What do you think?

I'll try to make a quick overview so it'll be easier to see the "big picture".
Currently we have following endpoints for dealing with specific task in a relation (source):

POST /mentorship_relation/{request_id}/task
DELETE /mentorship_relation/{request_id}/task/{task_id}
PUT /mentorship_relation/{request_id}/task/{task_id}/complete

I'm not a REST API specialist by any means, but in my opinion this part of the API design could be designed better, like:

POST /mentorship_relation/{request_id}/task
DELETE /mentorship_relation/{request_id}/task/{task_id}
PUT /mentorship_relation/{request_id}/task/{task_id} <---

PUT is a method that suits our use case best (as we only need to update 1 property of the resource).
Another advantage of this approach is that we'll need only 1 endpoint, not 2 (e.g ...{task_id}/complete and .../{task_id}/uncomplete).

Considering above, I'd lean towards the second approach.

@isabelcosta Do you approve suggested changes? I'd like to do this

@bartekpacia do you still want to work on this issue, which was approved already? Let me know so I can assign it to you ^^ Only then I can review. Trying to follow the Contributing Guidelines 馃檭

@isabelcosta I think it's done in #333

@bartekpacia Indeed it is, but I am trying to start practicing better the guidelines, and I need issues to be assigned. I will assign this to you then, since we discussed this so much. I just wanted to know, if I start requesting changes if you wanted to fix them or leave it for other contributor

oh wait...

oK forget, I got it, the description is not up to date with what is really going to be done here. all good

sure!
I will try fixing merge conflicts first

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rpattath picture rpattath  路  4Comments

daksha-aeer picture daksha-aeer  路  6Comments

isabelcosta picture isabelcosta  路  7Comments

daksha-aeer picture daksha-aeer  路  6Comments

daksha-aeer picture daksha-aeer  路  8Comments