Skip to content

form-data#146

Open
yzhyhaliuk wants to merge 3 commits intomate-academy:masterfrom
yzhyhaliuk:develop
Open

form-data#146
yzhyhaliuk wants to merge 3 commits intomate-academy:masterfrom
yzhyhaliuk:develop

Conversation

@yzhyhaliuk
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@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

Thank you for your work! There is one critical issue: the 'amount' field is currently stored as a string, but the requirements specify it should be a number. Please update your server code to convert 'amount' to a number before saving, and ensure the JSON file reflects this change. Once this is fixed, your solution will fully meet the task requirements. Keep going—you’re almost there! 🚀


✨ 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

Comment thread db/expense.json
@@ -1,5 +1,5 @@
{
"amount": "100",
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 value for 'amount' is a string ("100"). If the task requires 'amount' to be a number, you should remove the quotes so it becomes: 100. Please check the requirements or checklist for the correct type.

Comment thread src/createServer.js Outdated
}

const expense = {
amount: fields.amount,
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 'amount' field is saved directly from the request body (fields.amount). If the requirements specify that 'amount' should be a number, you should convert it to a number (e.g., using Number(fields.amount)) before saving. Otherwise, it will be saved as a string if the client sends it as such.

Copy link
Copy Markdown

@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

Thank you for your hard work! There is a critical issue that needs to be addressed before your solution can be approved: the 'amount' field is currently being stored as a string in the JSON file, but the requirements specify that it must be stored as a number. Please update your server code to convert 'fields.amount' to a number before saving, and ensure that the value in your JSON file is a number (not a string). Once this is fixed, your implementation will fully meet the task requirements. Keep going—you’re almost there! 🚀


✨ 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

Comment thread db/expense.json
@@ -1,5 +1,5 @@
{
"amount": "100",
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 'amount' field is currently stored as a string ("100"). According to the requirements, it should be stored as a number (e.g., 100 without quotes). Please update this value to be a number.

Comment thread src/createServer.js Outdated
}

const expense = {
amount: fields.amount,
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 'amount' field is being stored directly from the request body (fields.amount). According to the requirements, 'amount' must be stored as a number. Please convert 'fields.amount' to a number (e.g., using Number(fields.amount)) before saving it to the expense object.

Copy link
Copy Markdown

@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

Thank you for your submission! 🎉 Your project meets most of the requirements: the server correctly handles expense submissions, the HTML form is well-structured, and all necessary files are present. However, there is a critical issue that needs your attention: the 'amount' field in db/expense.json is still stored as a string (e.g., "100") instead of a number (e.g., 100). To fully comply with the requirements, please update the JSON file so that 'amount' is saved as a number, not a string. This is important for data consistency and future processing.

Despite this issue, your work is being approved to help you move forward with your learning journey. Please review the comments and address the highlighted issue in your next iteration. Paying attention to data types is crucial for robust applications. Keep up the good work, and don't hesitate to revisit the requirements or consult documentation on JSON data types if needed. You're making great progress—keep learning and improving! 🚀


✨ 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 db/expense.json
@@ -1,5 +1,5 @@
{
"amount": "100",
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 'amount' field is currently stored as a string ("100"). According to the requirements, it should be stored as a number (100). Please remove the quotes around the value to ensure it is saved as a number.

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