Skip to content

sol#204

Open
Skay9n wants to merge 2 commits into
mate-academy:masterfrom
Skay9n:develop
Open

sol#204
Skay9n wants to merge 2 commits into
mate-academy:masterfrom
Skay9n:develop

Conversation

@Skay9n
Copy link
Copy Markdown

@Skay9n Skay9n commented May 7, 2026

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

Your implementation has a critical routing bug that completely breaks form submission. In src/index.html line 8, the form action is "/add-exspense" (with a typo), but the server route in src/createServer.js line 23 expects "/add-expense". Every form submission will return a 404 error because the route doesn't exist. To fix the critical issue: Change action="/add-exspense" to action="/add-expense" in your HTML file. Additionally, consider replacing the

tags used as form labels with proper elements with for attributes. While this doesn't break functionality, using semantic HTML elements improves accessibility and is the correct approach for form labels. The core logic for handling the POST request, writing to the JSON file, and returning the formatted response is otherwise correct once the route matches. Fix the typo and your form should work as expected.


✨ 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 src/index.html Outdated
<title>Compression App</title>
</head>
<body>
<form method="POST" action="/add-exspense">
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Critical Issue: The form action has a typo - '/add-exspense' vs '/add-expense'. This route won't match the server handler on line 23, causing all form submissions to return 404.

Comment thread src/index.html Outdated
<body>
<form method="POST" action="/add-exspense">
<div>
<h1>Date</h1>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Using <h1> for form labels is semantically incorrect. These should be <label> elements with proper for attributes linking to their inputs.

Comment thread src/index.html Outdated
<div>
<h1>Date</h1>
<input type="date" name="date">
<h1>Title</h1>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Using <h1> for form labels is semantically incorrect. This should be a <label> element.

Comment thread src/index.html Outdated
<input type="date" name="date">
<h1>Title</h1>
<input type="text" name="title">
<h1>Amount</h1>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Using <h1> for form labels is semantically incorrect. This should be a <label> element.

Comment thread src/createServer.js
const fs = require('fs');

const querystring = require('querystring');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Typo in form action: '/add-exspense' should be '/add-expense' to match the server route on line 23. The form will submit to a non-existent endpoint, triggering a 404 response.

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

Your solution is approved. All critical issues from the previous review have been successfully resolved: the form action typo has been fixed to match the server route, and proper semantic <label> elements with for attributes are now in place. The implementation correctly handles POST requests to /add-expense, validates required fields (date, title, amount), saves data to db/expense.json, and returns well-formatted HTML with JSON output. All task requirements are met and no remaining issues exist.


✨ 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