File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # CLAUDE.md
2+
3+ ## Architecture
4+ - routes/users.js — the users resource, one route per action
5+ - db/store.js — the in-memory data helper all routes go through
6+ - tests/update-user.test.js — the tests
7+
8+
9+
Original file line number Diff line number Diff line change 1+ # NOTES.md
2+
3+ ## Plan
4+ Plan the new endpoint "update a user" to
5+
6+ - update an existing user by id (PUT /users/: id )
7+ - validate the input, rejecting missing or invalid fields with a clear error
8+ - return a sensible "not found" response when the user doesn't exist, rather than crashing
9+ - go through db/store.js for data access, following the existing pattern
10+
11+ The repo already contains the tests for this endpoint, in tests/update-user.test.js. They start red — making them pass is how
12+
13+
14+ ## Tasks
15+
16+ [ ] Add the updateUser function to db/store.js
17+ [ ] Add the PUT /users/: id route to routes/users.js
18+ [ ] Add input validation (return 400 for missing fields)
19+ [ ] Add 404 handling for non-existent users
20+
21+ ## Commits
22+ First commit contains changes to db/store.js
23+ Second commit contains the creation of the new endpoint (+ input validation, 400 and 404 return responses)
24+
25+ ## Model
26+ I will use opusplan
You can’t perform that action at this time.
0 commit comments