diff --git a/src/app/dashboard/TransactionHistory.tsx b/src/app/dashboard/TransactionHistory.tsx index 7495511..6c6c986 100644 --- a/src/app/dashboard/TransactionHistory.tsx +++ b/src/app/dashboard/TransactionHistory.tsx @@ -103,7 +103,7 @@ export const TransactionHistory = ({ status }: TransactionHistoryI) => { 'hover:underline hover:underline-offset-1' )} > -
{status?.toUpperCase()}
+{(status ?? '').toUpperCase()}
{!!midtrans_url && ( )} diff --git a/src/app/payment/PaymentDetail.tsx b/src/app/payment/PaymentDetail.tsx index 7e8170d..dfd2872 100644 --- a/src/app/payment/PaymentDetail.tsx +++ b/src/app/payment/PaymentDetail.tsx @@ -24,13 +24,13 @@ export const PaymentDetail = () => { getTransaction({ order_id: orderId }) } }, [orderId]) + const test_stat = null useEffect(() => { if (!!error && 'data' in error) { // Adjusted regex to correctly extract JSON surrounded by backticks const regex = /API response: `({.*})`/ const match = (error.data as MidtransErrorResponse).error.match(regex) - console.log(match) if (match && match[1]) { const jsonPart = match[1] try { @@ -77,11 +77,17 @@ export const PaymentDetail = () => {Package Name
{data?.transaction_detail.package.name}
Payment Type
-{data?.transaction_detail.payment_type?.toUpperCase()}
++ {(data?.transaction_detail.payment_type ?? '').toUpperCase()} +
Merchant
-{data?.transaction_detail.payment_merchant?.toUpperCase()}
++ {( + data?.transaction_detail.payment_merchant ?? '' + ).toUpperCase()} +
Status
-{data?.transaction_detail.status?.toUpperCase()}
+{(data?.transaction_detail.status ?? '')?.toUpperCase()}