fix group
This commit is contained in:
@ -21,33 +21,33 @@ import ConfirmDialog from '@/components/confirm';
|
||||
const BASE_URL_CUSTOMER = apiConfig.service_customer;
|
||||
|
||||
// ACCESS ADM
|
||||
export default function AdmAccess({page,formData,handleClose,fetchCustomers,viewOnly,setViewOnly}: any) {
|
||||
export default function AdmAccess({page,groups,formData,handleClose,fetchCustomers,viewOnly,setViewOnly}: any) {
|
||||
const [dialogOpen, setDialogOpen] = useState(false);
|
||||
const [dialogType, setDialogType] = useState('');
|
||||
const [changeGroup, setChangeGroup] = useState('');
|
||||
const [changeGroupD, setChangeGroupD] = useState(false);
|
||||
const [groups, setGroups] = useState([]);
|
||||
// const [groups, setGroups] = useState([]);
|
||||
|
||||
useEffect(() => {
|
||||
fetchGroups();
|
||||
// fetchGroups();
|
||||
}, []);
|
||||
|
||||
const fetchGroups = async () => {
|
||||
try {
|
||||
let getGroups = await axios.get(`${BASE_URL_CUSTOMER}/groups/list`, {
|
||||
params: {
|
||||
limit: 50,
|
||||
page: 1,
|
||||
with_deleted: false,
|
||||
order_field: 'name',
|
||||
order_direction: 'ASC'
|
||||
}
|
||||
});
|
||||
setGroups(getGroups.data.data.list);
|
||||
} catch (error: any) {
|
||||
toast.error(error.message);
|
||||
}
|
||||
};
|
||||
// const fetchGroups = async () => {
|
||||
// try {
|
||||
// let getGroups = await axios.get(`${BASE_URL_CUSTOMER}/groups/list`, {
|
||||
// params: {
|
||||
// limit: 50,
|
||||
// page: 1,
|
||||
// with_deleted: false,
|
||||
// order_field: 'name',
|
||||
// order_direction: 'ASC'
|
||||
// }
|
||||
// });
|
||||
// setGroups(getGroups.data.data.list);
|
||||
// } catch (error: any) {
|
||||
// toast.error(error.message);
|
||||
// }
|
||||
// };
|
||||
|
||||
const handleYes = async () => {
|
||||
try {
|
||||
@ -119,6 +119,7 @@ export default function AdmAccess({page,formData,handleClose,fetchCustomers,view
|
||||
function btnConfirmDialog(status: boolean) {
|
||||
setDialogOpen(status);
|
||||
}
|
||||
|
||||
if (!formData.id) return '';
|
||||
if (page !== 'kyc') {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user