From a0fecb89d45696cc76d30307fc0be25fc730cf45 Mon Sep 17 00:00:00 2001 From: wayanrivan Date: Mon, 9 Jun 2025 10:37:31 +0700 Subject: [PATCH] update rollback transaction --- .../home/user-profile/hooks/AccountUserProfileContext.tsx | 3 ++- .../history-transaction/hooks/TransactionContext.tsx | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pages/account/home/user-profile/hooks/AccountUserProfileContext.tsx b/src/pages/account/home/user-profile/hooks/AccountUserProfileContext.tsx index 30fc219..58e2e9b 100644 --- a/src/pages/account/home/user-profile/hooks/AccountUserProfileContext.tsx +++ b/src/pages/account/home/user-profile/hooks/AccountUserProfileContext.tsx @@ -109,7 +109,8 @@ const AccountUserProfileContextProvider = ({ children }: { children: React.React const handleSetPinCode = async (newPinCode: PinCodePayload) => { try { setPincodeState(newPinCode); - const customerid = getAuth()?.user?.customer?.id; + // const customerid = getAuth()?.user?.customer?.id; + const customerid = getAuth()?.user?.id; const response = await PutData(`${API_URL2}/customer/pin/${customerid}`, { old_pin: newPinCode.currentpincode, new_pin: newPinCode.newpincode, diff --git a/src/pages/transaction/history-transaction/hooks/TransactionContext.tsx b/src/pages/transaction/history-transaction/hooks/TransactionContext.tsx index f66ae91..b263725 100644 --- a/src/pages/transaction/history-transaction/hooks/TransactionContext.tsx +++ b/src/pages/transaction/history-transaction/hooks/TransactionContext.tsx @@ -292,7 +292,7 @@ const TransactionProvider = ({ children }: { children: React.ReactNode }) => { setSelectedTransactionId(row.id); setShowRollbackDialog(true); }} - disabled={row.status !== 'C'} + disabled={!['C', 'O'].includes(row.status)} > @@ -360,7 +360,7 @@ const TransactionProvider = ({ children }: { children: React.ReactNode }) => { // Build formattedFilter setelah semua nilai diketahui const formattedFilter: any = {}; - if( status) { + if (status) { formattedFilter["Transactions.status"] = status; }