Skip to content

Update user endpoint - #19

Open
MarynaLearning wants to merge 3 commits into
mate-academy:mainfrom
MarynaLearning:feature/update-user-endpoint
Open

Update user endpoint#19
MarynaLearning wants to merge 3 commits into
mate-academy:mainfrom
MarynaLearning:feature/update-user-endpoint

Conversation

@MarynaLearning

Copy link
Copy Markdown

Summary

  • Adds PUT /users/:id to update an existing user's name/email
  • Adds a db/store.js updateUser helper so the route stays consistent with the existing data-access pattern (no direct array mutation from routes)
  • Validates name/email are present (400) before checking the user exists (404), matching the existing error shapes from GET/POST

Test plan

  • npm test — all 9 tests pass, including the pre-existing tests/update-user.test.js grading contract
  • npm run lint — clean
  • Reviewed via /code-review (high effort, 6 finder angles + verification) — no correctness bugs survived; one minor duplicated-validation-block cleanup note left as-is given repo size

MarynaLearning and others added 3 commits July 2, 2026 20:17
Documents repo structure, commands, and conventions for Claude Code
sessions; also commits shared .claude/settings.json permissions and
stops tracking JetBrains project files.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Validates name/email are present before checking the user exists,
matching the existing 400/404 error conventions, and adds a
db/store.js updateUser helper so routes keep going through the
data-access layer.

Co-Authored-By: Claude Sonnet 5 <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