change group

This commit is contained in:
unknown
2025-04-09 14:09:17 +07:00
parent 929bb783f4
commit 490044a364

View File

@ -440,8 +440,10 @@ function getAdmAccess(page: string, data: any, handleClose: any, fetchCustomers:
await fetchCustomers() await fetchCustomers()
toast.success('Success Change group') toast.success('Success Change group')
} catch (error: any) { } catch (error: any) {
console.log(error);
toast.error(error.message) toast.error(error.message)
} finally { } finally {
await fetchCustomers()
setChangeGroupD(false) setChangeGroupD(false)
handleClose() handleClose()
} }
@ -548,7 +550,6 @@ function getPinStatus(status: string) {
} }
// CUSTOMER WALLET // CUSTOMER WALLET
function showCustomerWallet(customerid: any) { function showCustomerWallet(customerid: any) {
const [dialogOpen, setDialogOpen] = useState(false);
const [customerWallet, setCustomerWallet] = useState([]); const [customerWallet, setCustomerWallet] = useState([]);
if (!customerid) return '' if (!customerid) return ''
@ -565,14 +566,12 @@ function showCustomerWallet(customerid: any) {
} }
} }
const handleYes = async () => {}
return ( return (
<Box p={3} boxShadow={3} borderRadius={2} bgcolor="white"> <Box p={3} boxShadow={3} borderRadius={2} bgcolor="white">
<Typography variant="h6" gutterBottom>Wallet Member</Typography> <Typography variant="h6" gutterBottom>Wallet Member</Typography>
<Grid> <Grid>
<List> <List>
{customerWallet.map((item:any, index:any) => ( {customerWallet.length ? (customerWallet.map((item:any, index:any) => (
<React.Fragment key={item.id}> <React.Fragment key={item.id}>
<ListItem <ListItem
sx={{ sx={{
@ -612,17 +611,9 @@ function showCustomerWallet(customerid: any) {
</ListItem> </ListItem>
{index < customerWallet.length - 1 && <Divider sx={{ my: 1 }} />} {index < customerWallet.length - 1 && <Divider sx={{ my: 1 }} />}
</React.Fragment> </React.Fragment>
))} ))): "No wallet"}
</List> </List>
</Grid> </Grid>
<ConfirmDialog
open={dialogOpen}
onClose={() => setDialogOpen(false)}
title="Confirm Action"
content={`Are you sure you want to show?`}
onYes={handleYes}
onNo={() => setDialogOpen(false)}
/>
</Box> </Box>
) )
} }