Add PUT /users/:id endpoint - #26
Open
sophierousee3566 wants to merge 8 commits into
Open
Conversation
Supports the upcoming PUT /users/:id endpoint by mutating and returning the matched user, or undefined if no user has that id.
Validates name and email, returns 404 if the user doesn't exist, and delegates the update to db/store.js.
Documents the plan, model, commit split, and verification for the PUT /users/:id feature, satisfying the grading check in tests/notes.test.js.
Replaces the placeholder review section with actual /code-review output (8 finder angles, 2 verified low-severity findings) and explains why Sonnet 5 was chosen for this task.
Add PUT /users/:id endpoint
Actions were disabled by default on this fork; re-triggering here now that they've been enabled so the update-user endpoint gets a real CI run.
…endpoint" This reverts commit 44daeef.
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
updateUser(id, { name, email })todb/store.js, following the existinggetUserById/createUserpatternPUT /users/:idtoroutes/users.js: validatesname/email(400 on missing field), returns 404 if user not found, otherwise updates and returns the user (200)NOTES.mddocumenting the plan, model choice, commit split, and code review findingsWhat to test
PUT /users/1with{ "name": "New Name", "email": "new@example.com" }→ 200 with updated userPUT /users/9999with valid body → 404PUT /users/1with missingemail→ 400npm testpasses all 9 tests including the 3 grading cases intests/update-user.test.js.