IIT-BHU-InstiApp / lite-hai-backend

https://lite-hai.copsiitbhu.co.in/
13 stars 20 forks source link

Refactor API endpoints #42

Closed krashish8 closed 3 years ago

krashish8 commented 4 years ago

Move /tags/create/ to /clubs/{id}/tags/create/ and /workshops/create/ to /clubs/{id}/workshops/create/ Refactor other similar endpoints too (if any).

nishantwrp commented 4 years ago

@krashish8 I've forgotten the context of this issue. Do you remember?

krashish8 commented 4 years ago

@nishantwrp At present, we have the "club" attribute in /tags/create/ and /workshops/create/ endpoints. I think, as a better design, we should move these endpoints to /clubs/{id}/ instead of keeping a "club" attribute. That's all I remember :sweat_smile:

There may be other similar endpoints which shall be refactored in the same way.

krashish8 commented 3 years ago

@nishantwrp As we have made an endpoint which lists all the tags of a club, shall we remove the /tags/search/ endpoint? Any searching part, if required, can be done by the frontend now.

Also, we should create endpoints for PATCH | PUT | DELETE of tags of a club, right?

nishantwrp commented 3 years ago

Hmmm, yup we can. But will people editing already existing tags or just create a new tag? @nishantkr18

krashish8 commented 3 years ago

There may be typos that can be fixed by editing the tag. Since we will display all the tags of a club (to filter the workshop based on tags), I think it will be better to fix the typo rather than creating another tag. Well, there's another option - delete the tag and create a new one, depends on how you want to implement it in the frontend. @nishantkr18

nishantkr18 commented 3 years ago

In my opinion, providing an option for editing can be an overkill.. You can just create and delete tags. Lets keep it simple for the users. thoughts? @krashish8 @nishantwrp

krashish8 commented 3 years ago

The endpoints for creation and deletion of tags would be fine in my opinion.