Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update getUser endpoint #15

Open
chromium-52 opened this issue Oct 18, 2023 · 1 comment
Open

Update getUser endpoint #15

chromium-52 opened this issue Oct 18, 2023 · 1 comment
Assignees
Labels
backend Backend

Comments

@chromium-52
Copy link
Member

We should update the existing getUser endpoint to match the updated schema. The updated getUser endpoint will be used by:

  1. Any user to get their own info so they can view their own profile and update them if necessary on the profile/settings page
  2. A recruiter to pull up applicants' info (including their applications) so that they can review them
  3. An admin to get info on any user

Request Schema

GET /users/:userId

Response Schema

{
  ...User,
  "application": Application | null,
}

where User is the user entity

Error handling

A user can call this endpoint if:

  1. Calling user is admin
  2. Calling user is recruiter and status of user with the given userId is applicant
  3. Calling user's user ID is the same as the given userId (i.e. a user is trying to get their own info)

Otherwise, the route should respond with a 401 Unauthorized

@chromium-52
Copy link
Member Author

chromium-52 commented Oct 18, 2023

Will also close issue # 13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Backend
Projects
None yet
Development

No branches or pull requests

2 participants