Skip to content

Commit

Permalink
Fix bulk update missing subCategory
Browse files Browse the repository at this point in the history
  • Loading branch information
ystxn committed Oct 3, 2023
1 parent b3b26b8 commit bb0e235
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/transactions/bulk-transaction-dialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ const BulkTransactionDialog = ({

const submit = (event) => {
event.preventDefault();
const { category, remarks } = Object.fromEntries(new FormData(event.target).entries());
const { category, subCategory, remarks } = Object.fromEntries(new FormData(event.target).entries());
const values = {
ids: transactionToEdit,
category: category.trim().length === 0 ? null : category.trim(),
subCategory: subCategory.trim().length === 0 ? null : subCategory.trim(),
remarks: remarks.trim().length === 0 ? null : remarks.trim(),
};
if (selectedAccount?.type === 'Credit') {
Expand All @@ -76,6 +77,7 @@ const BulkTransactionDialog = ({
...t,
billingMonth: values.billingMonth || t.billingMonth,
category: values.category || t.category,
subCategory: values.subCategory || t.subCategory,
remarks: values.remarks || t.remarks,
})
);
Expand Down

0 comments on commit bb0e235

Please sign in to comment.