form-data#146
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
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,5 +1,5 @@ | |||
| { | |||
| "amount": "100", | |||
There was a problem hiding this comment.
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.
| } | ||
|
|
||
| const expense = { | ||
| amount: fields.amount, |
There was a problem hiding this comment.
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.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
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,5 +1,5 @@ | |||
| { | |||
| "amount": "100", | |||
There was a problem hiding this comment.
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.
| } | ||
|
|
||
| const expense = { | ||
| amount: fields.amount, |
There was a problem hiding this comment.
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.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
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,5 +1,5 @@ | |||
| { | |||
| "amount": "100", | |||
There was a problem hiding this comment.
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.
No description provided.