Skip to content

Conversation

@OksanaKuziv
Copy link

No description provided.

Copy link

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

Choose a reason for hiding this comment

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

Review Summary

This is a strong submission and the core logic is implemented correctly. However, a couple of changes are needed to fully align with the project's specific requirements.

First, the server must always respond with JSON. The current implementation sends a plain text 'Not Found' for non-GET requests, which contradicts the Content-Type header. Please ensure this response is also a JSON object, for example: JSON.stringify({ message: 'Not Found' }).

Second, the status message for validation errors needs a minor capitalization adjustment. The requirements specify 'Bad request', but the code currently uses 'Bad Request'. Please update this to match the specification exactly.

Once these two details are addressed, your solution will be fully compliant. Great work so far!


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

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example


if (req.method !== 'GET') {
res.statusCode = 404;
res.end('Not Found');

Choose a reason for hiding this comment

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

The requirements state that the server should always respond with JSON. This response for non-GET requests sends a plain text body ('Not Found'), which contradicts the Content-Type: application/json header set on line 7. Consider sending a JSON object here as well, for example: JSON.stringify({ message: 'Not Found' }).


if (errors.length > 0) {
res.statusCode = 400;
res.statusMessage = 'Bad Request';

Choose a reason for hiding this comment

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

The task requirements specify the status text should be exactly 'Bad request'. The current implementation uses 'Bad Request'. Please adjust the capitalization to match the requirements.

Copy link

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

Choose a reason for hiding this comment

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

Review Summary

Excellent work! You've successfully addressed all the points from the previous review. The server now correctly handles all responses with the application/json content type, and the status message for bad requests is exactly as specified. Your solution now fully meets all the requirements of the task, so I am approving it. Great job!


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

Footnotes

  1. Rate AI review example

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