fix member
This commit is contained in:
@ -85,16 +85,11 @@ const Kyc = () => {
|
||||
setDialogOpen(true);
|
||||
}
|
||||
|
||||
const resetForm = () => {
|
||||
setMember(initialMember);
|
||||
};
|
||||
|
||||
const handleYes = async () => {
|
||||
setLoading(true);
|
||||
const userLogin: any = await getUser();
|
||||
const updateData: any = member;
|
||||
const customerId = member.id;
|
||||
const description = member.description;
|
||||
const destinationGroup = updateData.destinationGroup;
|
||||
updateData.updated_by = userLogin.data ? userLogin.data.id : '';
|
||||
let today = new Date();
|
||||
@ -161,15 +156,13 @@ const Kyc = () => {
|
||||
description: updateData.approval_description_agent
|
||||
});
|
||||
}
|
||||
setDialogOpen(false);
|
||||
setIsDialogOpen(false);
|
||||
toast.success(`Success Update & ${dialogType} Kyc Member`);
|
||||
} catch (error: any) {
|
||||
if (error?.response?.data?.error) error.message = error?.response?.data?.error;
|
||||
setDialogOpen(false);
|
||||
setIsDialogOpen(false);
|
||||
toast.error(error.message);
|
||||
} finally {
|
||||
setDialogOpen(false);
|
||||
setIsDialogOpen(false);
|
||||
await fetchCustomers();
|
||||
setLoading(false);
|
||||
}
|
||||
@ -179,11 +172,15 @@ const Kyc = () => {
|
||||
setIsDialogOpen(el);
|
||||
}
|
||||
|
||||
if (loading) return <LoaderTransparant />;
|
||||
// const resetForm = () => {
|
||||
// setMember(initialMember);
|
||||
// };
|
||||
|
||||
useEffect(() => {
|
||||
if (!isDialogOpen) resetForm();
|
||||
}, [isDialogOpen]);
|
||||
// useEffect(() => {
|
||||
// if (!isDialogOpen) resetForm();
|
||||
// }, [isDialogOpen]);
|
||||
|
||||
if (loading) return <LoaderTransparant />;
|
||||
|
||||
return (
|
||||
<>
|
||||
@ -200,14 +197,6 @@ const Kyc = () => {
|
||||
onNo={() => setDialogOpen(false)}
|
||||
/>
|
||||
{member.id ? (
|
||||
// <CustomerDialog
|
||||
// open={isDialogOpen}
|
||||
// handleClose={closeDialog}
|
||||
// handleSubmit={handleSubmit}
|
||||
// initialData={member}
|
||||
// viewStats={true}
|
||||
// page={'kyc'}
|
||||
// />
|
||||
<DetailMember
|
||||
showAddDialog={isDialogOpen}
|
||||
setShowAddDialog={setShowAddDialog}
|
||||
@ -217,6 +206,7 @@ const Kyc = () => {
|
||||
initialData={member}
|
||||
fetchCustomers={fetchCustomers}
|
||||
profession={profession}
|
||||
dialogType={dialogType}
|
||||
page={'kyc'}
|
||||
/>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user