diff --git a/src/pages/transaction/approval-transaction/blocks/DetailApprovalTransaction.tsx b/src/pages/transaction/approval-transaction/blocks/DetailApprovalTransaction.tsx index 81d0025..4b5d549 100644 --- a/src/pages/transaction/approval-transaction/blocks/DetailApprovalTransaction.tsx +++ b/src/pages/transaction/approval-transaction/blocks/DetailApprovalTransaction.tsx @@ -504,38 +504,44 @@ const DetailApprovalTransaction = () => { - + - + - + {transactionDetails?.log && transactionDetails?.log.length > 0 ? ( - transactionDetails.log.map((log: { request_endpoint: string, status: string; request_date: string; response_date: string; request_body: string; response_body: string; response_code: number }, index: number) => ( + transactionDetails.log.map((log: { type: string, request_endpoint: string, status: string; request_date: string; response_date: string; request_body: string; response_body: string; response_code: number }, index: number) => ( - - - - - - + + + + + + )) ) : ( diff --git a/src/pages/transaction/history-transaction/blocks/DetailTransaction.tsx b/src/pages/transaction/history-transaction/blocks/DetailTransaction.tsx index c60a661..29c65c4 100644 --- a/src/pages/transaction/history-transaction/blocks/DetailTransaction.tsx +++ b/src/pages/transaction/history-transaction/blocks/DetailTransaction.tsx @@ -45,7 +45,7 @@ const DetailTransaction = () => { id: selectedTransactionId }); setTransactionDetails(response?.data); - // console.log(response?.data); + console.log(response?.data); // console.log(selectedTransactionId); } catch (error) { console.error('Error fetching transaction', error); @@ -515,38 +515,44 @@ const DetailTransaction = () => {
StatusType Request DateRequest BodyResponse Date Response Body Response CodeRequest End PointRequest Endpoint
- {(() => { - let status; - if (log.status === 'P') { - status = 'PENDING'; - } else if (log.status === 'O') { - status = 'ON PROCESS'; - } else if (log.status === 'F') { - status = 'FAILED'; - } else if (log.status === 'C') { - status = 'COMPLETE'; - } - return status; - })()} - {log.request_date ?? '-'}{log.response_date ?? '-'}{log.request_body ?? '-'}{log.response_body ?? '-'}{log.request_endpoint ?? '-'}{log.type}{log.request_date + ? new Date(log.request_date).toLocaleDateString('en-GB', { + day: '2-digit', + month: '2-digit', + year: 'numeric', + hour: '2-digit', + minute: '2-digit', + second: '2-digit', + hour12: false + }) + : ''}{log.response_date + ? new Date(log.response_date).toLocaleDateString('en-GB', { + day: '2-digit', + month: '2-digit', + year: 'numeric', + hour: '2-digit', + minute: '2-digit', + second: '2-digit', + hour12: false + }) + : ''}{log.request_body}{log.response_body}{log.request_endpoint}
- + - + - + {transactionDetails?.log && transactionDetails?.log.length > 0 ? ( - transactionDetails.log.map((log: { request_endpoint: string, status: string; request_date: string; response_date: string; request_body: string; response_body: string; response_code: number }, index: number) => ( + transactionDetails.log.map((log: { type: string, request_endpoint: string, status: string; request_date: string; response_date: string; request_body: string; response_body: string; response_code: number }, index: number) => ( - - - - - - + + + + + + )) ) : (
StatusType Request DateRequest BodyResponse Date Response Body Response CodeRequest End PointRequest Endpoint
- {(() => { - let status; - if (log.status === 'P') { - status = 'PENDING'; - } else if (log.status === 'O') { - status = 'ON PROCESS'; - } else if (log.status === 'F') { - status = 'FAILED'; - } else if (log.status === 'C') { - status = 'COMPLETE'; - } - return status; - })()} - {log.request_date ?? '-'}{log.response_date ?? '-'}{log.request_body ?? '-'}{log.response_body ?? '-'}{log.request_endpoint ?? '-'}{log.type}{log.request_date + ? new Date(log.request_date).toLocaleDateString('en-GB', { + day: '2-digit', + month: '2-digit', + year: 'numeric', + hour: '2-digit', + minute: '2-digit', + second: '2-digit', + hour12: false + }) + : ''}{log.response_date + ? new Date(log.response_date).toLocaleDateString('en-GB', { + day: '2-digit', + month: '2-digit', + year: 'numeric', + hour: '2-digit', + minute: '2-digit', + second: '2-digit', + hour12: false + }) + : ''}{log.request_body}{log.response_body}{log.request_endpoint}