Skip to content

Add PUT /users/:id endpoint - #26

Open
sophierousee3566 wants to merge 8 commits into
mate-academy:mainfrom
sophierousee3566:add-update-user-endpoint
Open

Add PUT /users/:id endpoint#26
sophierousee3566 wants to merge 8 commits into
mate-academy:mainfrom
sophierousee3566:add-update-user-endpoint

Conversation

@sophierousee3566

Copy link
Copy Markdown

Summary

  • Add updateUser(id, { name, email }) to db/store.js, following the existing getUserById/createUser pattern
    • Add PUT /users/:id to routes/users.js: validates name/email (400 on missing field), returns 404 if user not found, otherwise updates and returns the user (200)
    • Add NOTES.md documenting the plan, model choice, commit split, and code review findings

What to test

  • PUT /users/1 with { "name": "New Name", "email": "new@example.com" } → 200 with updated user
    • PUT /users/9999 with valid body → 404
    • PUT /users/1 with missing email → 400
      npm test passes all 9 tests including the 3 grading cases in tests/update-user.test.js.

Sophie Rouse and others added 8 commits July 7, 2026 10:27
Supports the upcoming PUT /users/:id endpoint by mutating and
returning the matched user, or undefined if no user has that id.
Validates name and email, returns 404 if the user doesn't exist,
and delegates the update to db/store.js.
Documents the plan, model, commit split, and verification for the
PUT /users/:id feature, satisfying the grading check in
tests/notes.test.js.
Replaces the placeholder review section with actual /code-review
output (8 finder angles, 2 verified low-severity findings) and
explains why Sonnet 5 was chosen for this task.
Actions were disabled by default on this fork; re-triggering here now
that they've been enabled so the update-user endpoint gets a real CI run.
…ndpoint"

This reverts commit 07e968d, reversing
changes made to 19e97af.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant