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;
|
isSubmittingEdit.value = true;
|
||||||
try {
|
try {
|
||||||
const payload = {
|
const payload = {
|
||||||
amount: editForm.amount,
|
amount: Number(editForm.amount),
|
||||||
status: editForm.status,
|
status: editForm.status,
|
||||||
dueDate,
|
dueDate,
|
||||||
notes: editForm.notes
|
notes: editForm.notes
|
||||||
@@ -368,8 +368,8 @@ const handleUpdateTransaction = async () => {
|
|||||||
payload.date = toGregorianIso(editForm.date);
|
payload.date = toGregorianIso(editForm.date);
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = await paymentApi.updateTransaction(editingTransactionId.value, payload);
|
await paymentApi.updateTransaction(editingTransactionId.value, payload);
|
||||||
payment.value = res.data || res;
|
await fetchPayment();
|
||||||
showSuccess('تراکنش با موفقیت بهروزرسانی شد');
|
showSuccess('تراکنش با موفقیت بهروزرسانی شد');
|
||||||
showEditModal.value = false;
|
showEditModal.value = false;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user