Skip to content

Commit

Permalink
Merge pull request #142 from simplitrac/fixed-submit
Browse files Browse the repository at this point in the history
fixed submitted user object
  • Loading branch information
squrki authored Sep 9, 2024
2 parents d6f4344 + 5464822 commit 4ab7213
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions client/src/components/ExpensesTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ const ExpensesForm = () => {

const transaction = new Transaction(ocrData);
transaction.createdAt = data.date;
transaction.vendor = data.vendor;
transaction.vendor = data.vendor.value;
transaction.amount = data.amount;
transaction.category_name = data.category;
transaction.category_name = data.category.value;

const updatedUser = new User(user);
updatedUser.transactions.push(transaction);
Expand Down
4 changes: 2 additions & 2 deletions client/src/models/Transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class Transaction {
} else {
this.transactionId = data.transaction_id || this.#generateUUID();
this.createdAt = data.created_at || null;
this.amount = data.amount || null;
this.vendor = data.vendor || null;
this.amount = (data instanceof Object ? data?.value : data.amount) || null;
this.vendor = (data instanceof Object ? data?.value : data.vendor) || null;
this.category_id = data.category_id || null;
this.category_name = data.category_name || null;
this.pictureId = data.pictureId || null;
Expand Down

0 comments on commit 4ab7213

Please sign in to comment.