We should update the existing getUser endpoint to match the updated schema. The updated getUser endpoint will be used by:
- Any user to get their own info so they can view their own profile and update them if necessary on the profile/settings page
- A recruiter to pull up applicants' info (including their applications) so that they can review them
- 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:
- Calling user is admin
- Calling user is recruiter and status of user with the given
userId is applicant
- 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
We should update the existing
getUserendpoint to match the updated schema. The updatedgetUserendpoint will be used by:Request Schema
GET /users/:userIdResponse Schema
where
Useris the user entityError handling
A user can call this endpoint if:
userIdis applicantuserId(i.e. a user is trying to get their own info)Otherwise, the route should respond with a
401 Unauthorized