Skip to content

Add PUT /users/:id update endpoint - #123

Open
aTiukhtii wants to merge 4 commits into
mate-academy:mainfrom
aTiukhtii:add-update-user-endpoint
Open

Add PUT /users/:id update endpoint#123
aTiukhtii wants to merge 4 commits into
mate-academy:mainfrom
aTiukhtii:add-update-user-endpoint

Conversation

@aTiukhtii

Copy link
Copy Markdown

Summary

  • Adds updateUser(id, { name, email }) to db/store.js following the existing store pattern
  • Adds PUT /users/:id route to routes/users.js with input validation (400) and not-found handling (404)
  • Adds NOTES.md submission write-up

Test plan

  • npm test — all 9 tests pass including the 3 update-user tests
  • PUT /users/:id with valid body → 200 + updated user
  • PUT /users/9999 → 404
  • PUT /users/:id with missing field → 400

🤖 Generated with Claude Code

aTiukhtii and others added 4 commits September 1, 2026 23:54
Adds updateUser(id, { name, email }) which mutates the matching user in
place and returns it, or returns null when no user with that id exists.
This is the data-layer piece needed for the PUT /users/:id endpoint.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Validates that both name and email are present (400 if not), delegates to
store.updateUser, and returns the updated user or 404 when the id does not
exist. All three update-user tests now pass; full suite is green.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers plan, model choice, commit split, and review outcome as required
by the course grading tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Linux CI filesystem is case-sensitive; the test looks for NOTES.md exactly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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