You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a GET route handler at /api/users that returns a list of all User records.
Success Criteria
If the request does not have a valid session, then GET /api/users returns a 401 status code with JSON body {"message": "Session required"}
If the request session user type is not STAFF, ADMIN or SUPER_ADMIN, then GET /api/users returns a 403 status code with JSON body {"message": "Must be STAFF, ADMIN, or SUPER_ADMIN"}
GET /api/users returns a 200 status code and all User records as JSON objects (include email and type fields only)
The route handler is documented with a description of its function, parameters, and responses
There is a test file that covers the success criteria
The text was updated successfully, but these errors were encountered:
Description
Create a
GET
route handler at/api/users
that returns a list of allUser
records.Success Criteria
GET /api/users
returns a401
status code with JSON body{"message": "Session required"}
STAFF
,ADMIN
orSUPER_ADMIN
, thenGET /api/users
returns a403
status code with JSON body{"message": "Must be STAFF, ADMIN, or SUPER_ADMIN"}
GET /api/users
returns a200
status code and allUser
records as JSON objects (includeemail
andtype
fields only)The text was updated successfully, but these errors were encountered: