fix member
This commit is contained in:
@ -262,14 +262,14 @@ const CustomerDialog = ({ open, handleClose, handleSubmit, initialData, viewStat
|
||||
<TextField disabled={viewOnly} fullWidth margin="dense" label="Bank Account" name="bank_account" value={formData.bank_account} onChange={handleChange} />
|
||||
<TextField disabled={viewOnly} fullWidth margin="dense" label="iBank Number" name="ibank_number" value={formData.ibank_number} onChange={handleChange} />
|
||||
<Divider className="pt-7"/>
|
||||
{getAdmAccess(page, formData, handleClose, fetchCustomers)}
|
||||
{/* {getAdmAccess(page, formData, handleClose, fetchCustomers)} */}
|
||||
{
|
||||
page === 'kyc' ? (
|
||||
<>
|
||||
<Typography sx={{color:'grey'}}>Approval</Typography>
|
||||
<TextField fullWidth margin="dense" label="Approval Description" name="description" value={formData.description} onChange={handleChange} />
|
||||
</>
|
||||
) : ('')
|
||||
) : (<>{getAdmAccess(page, formData, handleClose, fetchCustomers)}</>)
|
||||
}
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
@ -350,7 +350,6 @@ function getAdmAccess(page: string, data: any, handleClose: any, fetchCustomers:
|
||||
}
|
||||
});
|
||||
setGroups(getGroups.data.data.list);
|
||||
setChangeGroup(data.group_id);
|
||||
} catch (error: any) {
|
||||
console.error(error.message);
|
||||
toast.error(error.message)
|
||||
@ -394,6 +393,7 @@ function getAdmAccess(page: string, data: any, handleClose: any, fetchCustomers:
|
||||
customerid: data.id,
|
||||
destination_group: changeGroup
|
||||
}
|
||||
if (data.group_id === changeGroup) return toast.warning(`You update same group as the exist customer group`)
|
||||
if (dataObj.customerid && dataObj.destination_group) {
|
||||
await axios.post(`${BASE_URL_CUSTOMER}/customer/change-group`, dataObj)
|
||||
}
|
||||
@ -406,6 +406,11 @@ function getAdmAccess(page: string, data: any, handleClose: any, fetchCustomers:
|
||||
}
|
||||
}
|
||||
|
||||
function openChangeGroupDialog() {
|
||||
setChangeGroup(data.group_id);
|
||||
setChangeGroupD(true)
|
||||
}
|
||||
|
||||
if (page !== "kyc") {
|
||||
return (
|
||||
<Box p={3} boxShadow={3} borderRadius={2} bgcolor="white">
|
||||
@ -424,7 +429,7 @@ function getAdmAccess(page: string, data: any, handleClose: any, fetchCustomers:
|
||||
<Grid item xs={6} container direction="column" spacing={2}>
|
||||
<Grid item>
|
||||
<Typography variant="body2">Change Group</Typography>
|
||||
<Button onClick={() => setChangeGroupD(true)} variant="contained" color="primary">Change Group</Button>
|
||||
<Button onClick={() => openChangeGroupDialog()} variant="contained" color="primary">Change Group</Button>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<Typography variant="body2">Edit Member</Typography>
|
||||
@ -435,9 +440,9 @@ function getAdmAccess(page: string, data: any, handleClose: any, fetchCustomers:
|
||||
|
||||
<Dialog open={changeGroupD} onClose={() => setChangeGroupD(false)} fullWidth>
|
||||
<Grid container padding={3}>
|
||||
<Typography variant="h6" gutterBottom>Groups</Typography>
|
||||
<Typography variant="h6" gutterBottom color="orange">Are you sure to change customer Group?</Typography>
|
||||
<FormControl fullWidth margin="dense">
|
||||
<InputLabel>Destination Group</InputLabel>
|
||||
<Typography gutterBottom>Destination Group</Typography>
|
||||
<Select name="groups" value={changeGroup} onChange={(e: any) => setChangeGroup(e.target.value)}>
|
||||
{
|
||||
groups ? groups.map((el: any) => (
|
||||
@ -499,3 +504,7 @@ function getPinStatus(status: string) {
|
||||
res: null
|
||||
}
|
||||
}
|
||||
|
||||
function showCustomerWallet() {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user