RealDevSquad / RealDevSquad/website-backend
[RFC] Remove `/members/moveToMembers/:username`, and `members/archiveMembers/:username` and create a generic route
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 74
- Forks
- 276
- Avg merge
- 1d 26m
- Merged PRs (30d)
- 14
Description
Currently, we have the following two routes for adding member roles to users, and achieving them:
members/moveToMembers/:username: to add a member role to the usersmembers/archiveMembers/:username: to add archive role to the users
Problem with the approach used above
- If we want to remove those roles from the users, we need to create two more endpoints for removing those roles from the user ( basically making the value of the field false )
Solution
-
we create a generic route for adding and removing roles from a user:
/users/{userId}/roles: it will be a patch request, in the payload we will send an object which contains an object with role as a key and a boolean value which will update theroleaccording to that boolean value
@prakashchoudhary07 @RitikJaiswal75 @vvaibhavdesai @DashDeipayan please let me know what do you think
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the route definitions and handlers for members/moveToMembers/:username and members/archiveMembers/:username. Review how role values are currently updated and how the proposed /users/{userId}/roles PATCH payload should represent boolean changes. Done means the generic route and its behavior are agreed, with the two existing routes replaced and both adding and removing roles covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- api, backend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100