Skip to content

Add PUT /users/:id endpoint to update a user - #95

Open
darioduarte1 wants to merge 3 commits into
mate-academy:mainfrom
darioduarte1:main
Open

Add PUT /users/:id endpoint to update a user#95
darioduarte1 wants to merge 3 commits into
mate-academy:mainfrom
darioduarte1:main

Conversation

@darioduarte1

Copy link
Copy Markdown

Summary

  • Adds PUT /users/:id to update an existing user's name/email
  • Validates input (400 when a field is missing) and returns 404 when the id doesn't exist, following the patterns already used by GET /:id and POST /
  • Adds a matching updateUser helper in db/store.js

Test plan

  • npm test passes (9/9), including the pre-written tests/update-user.test.js (update, 404, 400 cases)
  • NOTES.md documents the plan, model choice, commit split, and self-review
  • To test manually: PUT /users/1 with a full body returns 200 with the updated user; PUT /users/9999 returns 404; PUT /users/1 with a missing field returns 400

🤖 Generated with Claude Code

darioduarte1 and others added 3 commits August 19, 2026 11:30
Validates name/email are present (400 if missing), returns 404 for
unknown ids, and updates via a new store.updateUser helper following
the existing store/route patterns.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Explains the plan, model choice, commit split, and self-review
findings for the update-user endpoint change.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Add PUT /users/:id endpoint to update a user
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