RealDevSquad / RealDevSquad/website-backend

[RFC] Remove `/members/moveToMembers/:username`, and `members/archiveMembers/:username` and create a generic route

Open
#1,093 4 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

RFC
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 users
  • members/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 the role according to that boolean value

    @prakashchoudhary07 @RitikJaiswal75 @vvaibhavdesai @DashDeipayan please let me know what do you think

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.