Skip to content

Update getUser endpoint #15

@chromium-52

Description

@chromium-52

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions