fixing kyc delete member, transaction topup request, disbursement saldo
This commit is contained in:
@ -9,11 +9,12 @@ import { Input } from '@/components/ui/input';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { useManageKycDeletionContext } from '../hooks';
|
||||
import { apiConfig } from '@/config/api.config';
|
||||
import axios from 'axios';
|
||||
import { useDataGrid } from '@/components';
|
||||
|
||||
const API_URL = apiConfig.service_customer;
|
||||
const DetailDialog = () => {
|
||||
const { showDetailDialog, setShowDetailDialog, detailKyc, handleApproveReject } = useManageKycDeletionContext();
|
||||
const { reload } = useDataGrid();
|
||||
|
||||
return (
|
||||
<Dialog open={showDetailDialog} onOpenChange={setShowDetailDialog}>
|
||||
@ -38,8 +39,14 @@ const DetailDialog = () => {
|
||||
|
||||
<div className="flex justify-end gap-2 mt-3">
|
||||
<Button type="button" variant="outline" onClick={() => setShowDetailDialog(false)}>Cancel</Button>
|
||||
<Button onClick={() => handleApproveReject(detailKyc.id, 'N')} variant="destructive" color="warning">Reject</Button>
|
||||
<Button onClick={() => handleApproveReject(detailKyc.id, 'Y')} variant="default" color="primary">Approve</Button>
|
||||
<Button onClick={async() => {
|
||||
await handleApproveReject(detailKyc.id, 'N')
|
||||
reload()
|
||||
}} variant="destructive" color="warning">Reject</Button>
|
||||
<Button onClick={async() => {
|
||||
await handleApproveReject(detailKyc.id, 'Y')
|
||||
reload()
|
||||
}} variant="default" color="primary">Approve</Button>
|
||||
</div>
|
||||
</div>
|
||||
) : (<div></div>)}
|
||||
|
||||
@ -37,7 +37,7 @@ interface ContextProps {
|
||||
selectedIdCustomer: string | null;
|
||||
detailKyc: any | null;
|
||||
setDetailKyc: React.Dispatch<React.SetStateAction<any>>;
|
||||
handleApproveReject: (customerDeletionId: string, status_approve: string) => {};
|
||||
handleApproveReject: (customerDeletionId: string, status_approve: string) => Promise<any>;
|
||||
}
|
||||
|
||||
const initialProps: ContextProps = {
|
||||
@ -50,7 +50,7 @@ const initialProps: ContextProps = {
|
||||
setShowDetailDialog: () => { },
|
||||
detailKyc: async () => {},
|
||||
setDetailKyc: () => { },
|
||||
handleApproveReject: () => ({customerDeletionId: '0', status_approve: 'Y'}),
|
||||
handleApproveReject: async () => ({customerDeletionId: '0', status_approve: 'Y'}),
|
||||
};
|
||||
|
||||
const ManageKycDeletionContext = createContext<ContextProps>(initialProps);
|
||||
@ -271,7 +271,6 @@ const ManageKycDeletionContextProvider = ({ children }: { children: React.ReactN
|
||||
}}
|
||||
>
|
||||
<Toaster expand visibleToasts={9} duration={3000} />
|
||||
<DetailDialog />
|
||||
|
||||
<DataGridProvider
|
||||
columns={columns}
|
||||
@ -285,6 +284,7 @@ const ManageKycDeletionContextProvider = ({ children }: { children: React.ReactN
|
||||
}
|
||||
>
|
||||
{children}
|
||||
<DetailDialog />
|
||||
</DataGridProvider>
|
||||
</ManageKycDeletionContext.Provider>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user