fix reject
This commit is contained in:
@ -109,6 +109,7 @@ const Kyc = () => {
|
|||||||
const updateData: any = member;
|
const updateData: any = member;
|
||||||
const customerId = member.id;
|
const customerId = member.id;
|
||||||
const description = member.description;
|
const description = member.description;
|
||||||
|
const destinationGroup = updateData.destinationGroup;
|
||||||
updateData.updated_by = userLogin.data ? userLogin.data.id : '';
|
updateData.updated_by = userLogin.data ? userLogin.data.id : '';
|
||||||
let today = new Date();
|
let today = new Date();
|
||||||
updateData.updated_at = today.toString();
|
updateData.updated_at = today.toString();
|
||||||
@ -151,15 +152,12 @@ const Kyc = () => {
|
|||||||
if (updateData[property]) form.append(property, updateData[property]);
|
if (updateData[property]) form.append(property, updateData[property]);
|
||||||
}
|
}
|
||||||
if (dialogType === 'reject') {
|
if (dialogType === 'reject') {
|
||||||
await axios.post(`${BASE_URL}/customer/reject`, { customerid: customerId });
|
if (destinationGroup === "Premium") await axios.post(`${BASE_URL}/customer/reject`, { customerid: customerId, description: updateData.approval_description_premium });
|
||||||
|
if (destinationGroup === "Agent") await axios.post(`${BASE_URL}/customer/reject`, { customerid: customerId, description: updateData.approval_description_agent });
|
||||||
}
|
}
|
||||||
if (dialogType === 'update') {
|
if (dialogType === 'update') {
|
||||||
await axios.put(`${BASE_URL}/customer/update/${customerId}`, form);
|
await axios.put(`${BASE_URL}/customer/update/${customerId}`, form);
|
||||||
if (updateData.isneedapproval == 1)
|
if (updateData.isneedapproval == 1) await axios.post(`${BASE_URL}/customer/approve`, { customerid: customerId, description: description});
|
||||||
await axios.post(`${BASE_URL}/customer/approve`, {
|
|
||||||
customerid: customerId,
|
|
||||||
description: description
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
await fetchCustomers();
|
await fetchCustomers();
|
||||||
setDialogOpen(false);
|
setDialogOpen(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user