Refetch payment after transaction edit to show updated amount.
Coerce edited amount to a number and reload invoice data after save.
This commit is contained in:
@@ -357,7 +357,7 @@ const handleUpdateTransaction = async () => {
|
||||
isSubmittingEdit.value = true;
|
||||
try {
|
||||
const payload = {
|
||||
amount: editForm.amount,
|
||||
amount: Number(editForm.amount),
|
||||
status: editForm.status,
|
||||
dueDate,
|
||||
notes: editForm.notes
|
||||
@@ -368,8 +368,8 @@ const handleUpdateTransaction = async () => {
|
||||
payload.date = toGregorianIso(editForm.date);
|
||||
}
|
||||
|
||||
const res = await paymentApi.updateTransaction(editingTransactionId.value, payload);
|
||||
payment.value = res.data || res;
|
||||
await paymentApi.updateTransaction(editingTransactionId.value, payload);
|
||||
await fetchPayment();
|
||||
showSuccess('تراکنش با موفقیت بهروزرسانی شد');
|
||||
showEditModal.value = false;
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user