Skip to content

feat: Solution#1086

Open
andriiLink wants to merge 2 commits intomate-academy:masterfrom
andriiLink:develop
Open

feat: Solution#1086
andriiLink wants to merge 2 commits intomate-academy:masterfrom
andriiLink:develop

Conversation

@andriiLink
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 an excellent submission with a very clean and well-organized structure. You've correctly implemented almost all the requirements. However, there's one small but crucial detail missing that requires a change. The task specifies that the server must respond with a custom statusText for both success and error cases. For successful requests, the status should be 200 OK, and for validation failures, it should be 400 Bad request. Currently, your code in src/createServer.js sets the statusCode but not the message. You can fix this by setting the res.statusMessage property, for example: res.statusMessage = 'OK';. Once you add this for both the success and error paths, your solution will be perfect!


✨ 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 (params.errorArr && params.errorArr.length > 0) {
const errorResponse = prepareErrors(params.errorArr);

res.statusCode = 400;

Choose a reason for hiding this comment

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

The task requires responding with a Bad request statusText for validation failures. While Node.js often sets a default message, it's important to set it explicitly as required. You can set it using res.statusMessage.

convertedText: data.convertedText,
};

res.statusCode = 200;

Choose a reason for hiding this comment

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

The requirements state that for a successful request, the server should respond with an OK status text. You've set the status code correctly, but are missing the status message. Please add res.statusMessage = 'OK'; to fully meet 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! I am approving your solution. You've successfully addressed the feedback from the previous review, and your submission now perfectly meets all requirements. The code is well-structured, clean, and correctly implements custom status messages for both success and error responses. This is a great final result, keep up the fantastic work!


✨ 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.

3 participants