Update user endpoint - #19
Open
MarynaLearning wants to merge 3 commits into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PUT /users/:idto update an existing user's name/emaildb/store.jsupdateUserhelper so the route stays consistent with the existing data-access pattern (no direct array mutation from routes)name/emailare present (400) before checking the user exists (404), matching the existing error shapes from GET/POSTTest plan
npm test— all 9 tests pass, including the pre-existingtests/update-user.test.jsgrading contractnpm run lint— clean/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