Skip to content

Commit 8aae5ee

Browse files
Add NOTES.md
Plan, model choice, commit split, and self-review findings for the update-user endpoint.
1 parent cd7023b commit 8aae5ee

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

NOTES.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Notes — update-user endpoint
2+
3+
**Plan.** Add `PUT /users/:id` to `routes/users.js` plus an `updateUser(id, { name, email })`
4+
helper in `db/store.js`, mirroring the existing `getUserById`/`createUser` pattern so the
5+
route stays thin and all data access goes through the store. Validate `name` and `email`
6+
the same way `POST /users` already does (400 if either is missing), and return 404 when
7+
the id doesn't exist. The plan matched the tests in `tests/update-user.test.js` directly,
8+
so I approved it without edits.
9+
10+
**Model.** Claude Sonnet 5 — this is a small, well-scoped change against a codebase whose
11+
conventions are obvious from the existing routes, so no need for a heavier model.
12+
13+
**Commits.** Split into two: one adding `updateUser` to `db/store.js`, one adding the
14+
`PUT /:id` route that uses it. Each commit is a complete, reviewable unit — the store
15+
change makes sense on its own (a new data-access helper following the existing pattern),
16+
and the route change is easy to read against it without needing to hold both diffs in
17+
your head at once.
18+
19+
**Review.** Ran a self-review (`/code-review`) before opening the PR. It came back clean:
20+
no removed behavior or broken call sites, `Number(req.params.id)` producing `NaN` for a
21+
non-numeric id still falls through correctly to the 404 path via `===`, and mutating the
22+
found user in place is consistent with how the in-memory store already works. No changes
23+
were needed.

0 commit comments

Comments
 (0)