Skip to content

solution#159

Open
VasylPylypchynets wants to merge 1 commit intomate-academy:masterfrom
VasylPylypchynets:develop
Open

solution#159
VasylPylypchynets wants to merge 1 commit intomate-academy:masterfrom
VasylPylypchynets:develop

Conversation

@VasylPylypchynets
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

Great job! 🎉 Your implementation meets all the stated requirements for the task. While overwriting the file with each new expense could be improved for a real-world application, the current approach is acceptable based on the given requirements. Keep up the good work, and consider enhancing the storage logic in future projects!


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

Footnotes

  1. Rate AI review example


const dbPath = path.join(__dirname, '../', './db/expense.json');

fs.writeFileSync(dbPath, JSON.stringify(expense));

Choose a reason for hiding this comment

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

Issue: Using fs.writeFileSync(dbPath, JSON.stringify(expense)); will overwrite the entire expense.json file with each new expense, so only the latest expense will be saved. If the task requires storing multiple expenses, you should read the existing data, append the new expense, and then write the updated array back to the file.

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