Quote
"People will hear a fart, but no one reacts until it starts to smell. In life, nobody cares about the work you put in, only the results" - Lil drop top
Description
This PR implements backend CRUD endpoints for the users table, following the same pattern as projects.js.
Instructions
Task
- Create
server/routes/users.js
- Implement:
GET /users — return all users
POST /users — create a new user (sign up), validate project_id exists
PUT /users/:id — update a user's info (ex: email, project_id)
DELETE /users/:id — remove a user
- Use the right HTTP status codes for each endpoint
- Test all four endpoints in Postman (seed users table if necessary), add images of successful tests for each endpoint to PR
- Mount the new router in
app.js under '/users'
Acceptance Criteria
Resources
Quote
"People will hear a fart, but no one reacts until it starts to smell. In life, nobody cares about the work you put in, only the results" - Lil drop top
Description
This PR implements backend CRUD endpoints for the
userstable, following the same pattern asprojects.js.Instructions
Task
server/routes/users.jsGET /users— return all usersPOST /users— create a new user (sign up), validateproject_idexistsPUT /users/:id— update a user's info (ex: email, project_id)DELETE /users/:id— remove a userapp.jsunder '/users'Acceptance Criteria
users.jsroute file createdGET /usersreturns all usersPOST /userscreates a user and returns the new recordPUT /users/:idupdates a user, returns right HTTP code ifiddoesn't existDELETE /users/:idremoves a user, returns right HTTP code ifiddoesn't existapp.jsResources
server/routes/projects.js(reference pattern)