approval member
This commit is contained in:
@ -6,6 +6,7 @@ import { ManageKycContextProvider } from './hooks';
|
||||
import { columns, initialMember } from '../manage-members/Columns';
|
||||
import { useAuthContext } from '@/auth';
|
||||
import { apiConfig } from '@/config/api.config';
|
||||
import ConfirmDialog from '@/components/confirm';
|
||||
import axios from 'axios';
|
||||
const BASE_URL = apiConfig.service_customer;
|
||||
import CustomerDialog from '../manage-members/CustomerDetailModal';
|
||||
@ -52,7 +53,7 @@ const Kyc = () => {
|
||||
with_deleted: false,
|
||||
order_field: 'fullname',
|
||||
order_direction: 'ASC',
|
||||
// type: "Reguler"
|
||||
type: "kyc"
|
||||
}
|
||||
});
|
||||
let temp = 1
|
||||
@ -105,6 +106,7 @@ const Kyc = () => {
|
||||
delete updateData.group_deleted_at;
|
||||
try {
|
||||
await axios.put(`${BASE_URL}/customer/update/${customerId}`, updateData)
|
||||
if (updateData.isneedapproval == 1) await axios.post(`${BASE_URL}/customer/approve`, {customerid: customerId})
|
||||
await fetchGroups();
|
||||
setIsDialogOpen(false)
|
||||
} catch (error: any) {
|
||||
@ -116,6 +118,14 @@ const Kyc = () => {
|
||||
return (
|
||||
<div>
|
||||
<div className="container mx-auto py-5">
|
||||
<ConfirmDialog
|
||||
open={dialogOpen}
|
||||
onClose={() => setDialogOpen(false)}
|
||||
title="Confirm Action"
|
||||
content={`Are you sure you want to `+( dialogType === 'create' ? "create?" : ( dialogType === 'update' ? "update?" : "delete?"))}
|
||||
onYes={handleYes}
|
||||
onNo={() => setDialogOpen(false)}
|
||||
/>
|
||||
<CustomerDialog open={isDialogOpen} handleClose={closeDialog} handleSubmit={handleSubmit} initialData={member} viewStats={true}/>
|
||||
<h1 className="text-xl font-medium leading-none text-gray-900 mb-7">Manage Member KYC</h1>
|
||||
<DataTable data={members} columns={columns} onUpdate={handleUpdate} onDelete={null}/>
|
||||
|
||||
Reference in New Issue
Block a user