Add PUT /users/:id endpoint (#1) - #74
Open
lehmoja wants to merge 3 commits into
Open
Conversation
* Add updateUser helper to the store
Adds an updateUser(id, {name, email}) function to db/store.js so
routes can update a user's fields, following the same pattern as
createUser. Returns undefined for an unknown id so callers can
branch on a falsy result, same as getUserById.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Add PUT /users/:id endpoint
Adds the update-a-user route: validates that name and email are
present (400 otherwise), looks up and updates via
store.updateUser, and returns 404 when the id doesn't match an
existing user. Turns tests/update-user.test.js green.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Add NOTES.md
Documents the approved plan, the model used, why the commits were
split the way they were, and what self-review caught before
opening the PR.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Adds Prettier (2-space indent) since the repo had no dedicated formatter, and wires a Claude Code hook to run it after every Write/Edit tool call. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011CZ5XFpPxJDvRTgKERHPuQ
Denies any Bash command invoking npm publish, including chained and npx-wrapped forms. Moved the matching logic into a script (.claude/hooks/block-npm-publish.sh) that strips heredoc bodies before matching, so prose that happens to mention "npm publish" (e.g. inside a git commit message) isn't mistaken for a real invocation and blocked. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011CZ5XFpPxJDvRTgKERHPuQ
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.
Adds an updateUser(id, {name, email}) function to db/store.js so routes can update a user's fields, following the same pattern as createUser. Returns undefined for an unknown id so callers can branch on a falsy result, same as getUserById.
Adds the update-a-user route: validates that name and email are present (400 otherwise), looks up and updates via
store.updateUser, and returns 404 when the id doesn't match an existing user. Turns tests/update-user.test.js green.
Documents the approved plan, the model used, why the commits were split the way they were, and what self-review caught before opening the PR.