Skip to content

Add PUT /users/:id (update a user) - #103

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

Add PUT /users/:id (update a user)#103
sernadesigns wants to merge 4 commits into
mate-academy:mainfrom
sernadesigns:update-user-endpoint

Conversation

@sernadesigns

Copy link
Copy Markdown

Summary

  • Implement PUT /users/:id to update an existing user's name and email, following the conventions already used by the other user routes (db/store.js#updateUser, routes/users.js).
  • Reduce duplication introduced by the new endpoint: updateUser now reuses getUserById for its lookup, and POST/PUT share a hasNameAndEmail validator instead of each duplicating the required-field check.
  • Add CLAUDE.md and NOTES.md documenting the project and the process behind this change.

Test plan

  • npm test — all 9 tests pass, including the 3 in tests/update-user.test.js
  • npm run lint — clean

https://claude.ai/code/session_01RL3gsnyHshwFzHxGZAwpDM

sernadesigns and others added 4 commits August 24, 2026 23:02
updateUser now reuses getUserById instead of re-implementing the id
lookup, and POST/PUT share a hasNameAndEmail validator instead of
duplicating the required-field check.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RL3gsnyHshwFzHxGZAwpDM
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RL3gsnyHshwFzHxGZAwpDM
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