Skip to content

[FEATURE] Add Permission Requests for joining the LeetCode Leaderboard #2102

@adarshm11

Description

@adarshm11

#1981 must be merged before we do this

inspired by the permission requests for the led sign, we should allow users to make requests to join the sce leetcode leaderboard! right now there's a QR code for signups on a google form that export to a google sheet and people who apply just wait for someone to manually add them and there's no one looking at allat 🦗

so let's just let them be more direct! it's much easier for someone to just go on clark and approve/deny these things

  • we need to modify the schema for led sign permission requests. refer to the current schema definition. can we make it so that each permission request has a field denoting which service (e.g. 'LedSign', 'LeetcodeLeaderboard') it's requesting?

then we need to modify the permission request API routes

  • the / route queries for all permission requests so that an officer/admin can view and accept/decline. but this is currently hardcoded for led sign only. this should be made to accept a query parameter for the service, and based on that query parameter, the PermissionRequest collection should be conditionally queried to find only requests that match that service
  • the /create, /delete, and /approve endpoints should also be modified to accept a body parameter denoting which service is being requested, and appropriately query the db for documents that match that service.
  • make sure to modify the api functions and the led sign page to correctly pass in the name of the led sign service to the api requests
  • next we need a new component on the frontend where, on the leaderboard page, officers can see users who applied and approve/deny their requests. that would call the endpoint to approve/deny obv. this can reuse the api functions.
  • finally once requests are approved, clark will need to make an api request to the /user/add endpoint on sign2. refer to sign2 source code for that implementation

food for thought: what if there's a way to autonomously verify if a leetcode profile exists? some jits make typos in their leetcode profile so we don't wanna force officers to manually check the profiles on leetcode (if possible). could we check https://leetcode.com/u/{username} to see if that profile exists, and auto delete requests made with profiles that don't exist? does leetcode allow that? experiment with ts!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions