Skip to content

Commit

Permalink
Fix updating of monthly summary with async handleTransactions
Browse files Browse the repository at this point in the history
  • Loading branch information
JJtan2002 committed Jun 18, 2024
1 parent e031fa3 commit 5ac6648
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/src/pages/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Profile = () => {
const expenseCategories = ["Food", "Transportation", "Housing", "Utilities", "Entertainment"];
const incomeCategories = ["Salary", "Freelance Income", "Investment", "Gifts", "Other"];

const handleTransaction = (ev) => {
const handleTransaction = async (ev) => {
ev.preventDefault();
const date = new Date();
const isoDateString = date.toISOString(ev.target.date.value); // "YYYY-MM-DD" format for DateField
Expand All @@ -63,8 +63,8 @@ const Profile = () => {
};
console.log(formData);

createTransaction({ transaction: formData });
refetchWallet();
await createTransaction({ transaction: formData });
await refetchWallet();
}


Expand Down

0 comments on commit 5ac6648

Please sign in to comment.