Skip to content

Shipped change - #143

Open
laszlozsidek wants to merge 5 commits into
mate-academy:mainfrom
laszlozsidek:shipped-change
Open

Shipped change#143
laszlozsidek wants to merge 5 commits into
mate-academy:mainfrom
laszlozsidek:shipped-change

Conversation

@laszlozsidek

Copy link
Copy Markdown

No description provided.

laszlozsidek and others added 5 commits September 8, 2026 16:38
Adds a data-access function to update an existing user by id,
returning undefined when the id doesn't exist, mirroring the
not-found handling already used by getUserById.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E6kkuE2k1kVobAGLNPt4uT
Updates an existing user, validating that name and email are
present (400 if missing) and returning 404 when the user doesn't
exist, following the same pattern as the existing GET/POST routes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E6kkuE2k1kVobAGLNPt4uT
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E6kkuE2k1kVobAGLNPt4uT
Previously, missing name/email was validated before checking whether
the user exists, so PUT to a nonexistent id with an incomplete body
returned 400 instead of 404, masking the real problem. Now existence
is checked first.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E6kkuE2k1kVobAGLNPt4uT
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E6kkuE2k1kVobAGLNPt4uT

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

I am approving this submission because the core functionality is correctly implemented and matches the requirements. The PUT /users/:id route validates inputs (returns 400 for missing name or email), returns 404 for unknown IDs, and updates users via db/store.updateUser, which returns undefined when not found—this aligns with the task’s expectations. Tests for these behaviors should pass given the current logic.

Minor improvements are suggested for clarity in NOTES.md: make commit counts consistent, list which files were changed and why, rewrite a few ambiguous sentences (e.g., “I made Claude to create the plan,” “3rd step had no impact on the code”) in plain language, and add a brief confirmation that local tests (npm test) passed and that NOTES.md was committed. These are documentation refinements and not blockers.

Nice work delivering a clean, predictable update flow and adhering to the data-access pattern. Keep the documentation tweaks in mind to make verification even smoother.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Comment thread NOTES.md
@@ -0,0 +1,2 @@
I made Claude to create the plan. I approved the 1st and 2nd steps: add/implement the updateUser() function and add PUT handler to routes.js. 3rd step had no impact on the code. In the 4th step would have created and filled the NOTES.md file. I asked to skip it as I had to do that. I chose Sonnet for model because this task seemed not be too complex, and so the whole is cheaper. Two commits were asked: 1: store.js as it contains the updateUser() function; 2: users.js as it uses updateUser(). 3rd will contain NOTES.md. After saving this with content everything was fine, all tests were green. The review caught 1 bug, which was fixed in the 4th commit.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file should clearly state what was actually changed (which files were modified and why). Right now it says steps were approved but doesn't explicitly confirm which files were committed or the final status besides "tests were green". Consider listing the actual commits or the exact files changed to make verification straightforward.

Comment thread NOTES.md
@@ -0,0 +1,2 @@
I made Claude to create the plan. I approved the 1st and 2nd steps: add/implement the updateUser() function and add PUT handler to routes.js. 3rd step had no impact on the code. In the 4th step would have created and filled the NOTES.md file. I asked to skip it as I had to do that. I chose Sonnet for model because this task seemed not be too complex, and so the whole is cheaper. Two commits were asked: 1: store.js as it contains the updateUser() function; 2: users.js as it uses updateUser(). 3rd will contain NOTES.md. After saving this with content everything was fine, all tests were green. The review caught 1 bug, which was fixed in the 4th commit.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are grammar and clarity issues that make the meaning ambiguous (e.g., "I made Claude to create the plan", "3rd step had no impact on the code"). Please rewrite to plain language describing the plan you approved and any edits you made before approving.

Comment thread NOTES.md
@@ -0,0 +1,2 @@
I made Claude to create the plan. I approved the 1st and 2nd steps: add/implement the updateUser() function and add PUT handler to routes.js. 3rd step had no impact on the code. In the 4th step would have created and filled the NOTES.md file. I asked to skip it as I had to do that. I chose Sonnet for model because this task seemed not be too complex, and so the whole is cheaper. Two commits were asked: 1: store.js as it contains the updateUser() function; 2: users.js as it uses updateUser(). 3rd will contain NOTES.md. After saving this with content everything was fine, all tests were green. The review caught 1 bug, which was fixed in the 4th commit.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The notes mention choosing the "Sonnet" model and that it was chosen to reduce cost — the course asked to state which model was chosen and why, which you've done, but consider also adding a sentence confirming that the tests passed locally (e.g., npm test passed) and that NOTES.md was committed as required by the grading script.

Comment thread NOTES.md
@@ -0,0 +1,2 @@
I made Claude to create the plan. I approved the 1st and 2nd steps: add/implement the updateUser() function and add PUT handler to routes.js. 3rd step had no impact on the code. In the 4th step would have created and filled the NOTES.md file. I asked to skip it as I had to do that. I chose Sonnet for model because this task seemed not be too complex, and so the whole is cheaper. Two commits were asked: 1: store.js as it contains the updateUser() function; 2: users.js as it uses updateUser(). 3rd will contain NOTES.md. After saving this with content everything was fine, all tests were green. The review caught 1 bug, which was fixed in the 4th commit.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The closing sentence references a bug fixed in a "4th commit", but earlier you said there were only two (or three) commits. Make the commit count consistent: either list each commit and its purpose or correct the numbers so reviewers can follow the history.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants