✨ Auto refresh on vote super admin
This commit is contained in:
parent
e96fdf617c
commit
8773e5f25b
@ -71,7 +71,7 @@ export default function UserInformations(props: IProps) {
|
||||
const roles = await Roles.getInstance().get({
|
||||
where: { NOT: { OR: [{ name: "super-admin" }, { name: "admin" }] } },
|
||||
});
|
||||
if (!roles) return
|
||||
if (!roles) return;
|
||||
setAvailableRoles(roles.map((role) => ({ value: role.uid, label: role.label })));
|
||||
setUserSelected(user);
|
||||
}, [userUid]);
|
||||
@ -140,8 +140,9 @@ export default function UserInformations(props: IProps) {
|
||||
}),
|
||||
);
|
||||
}
|
||||
getUser();
|
||||
setIsAdminModalOpened(false);
|
||||
}, [userSelected, adminModalType]);
|
||||
}, [userSelected, adminModalType, getUser]);
|
||||
|
||||
/** Functions for the super admin modal */
|
||||
const openSuperAdminModal = () => {
|
||||
@ -286,7 +287,7 @@ export default function UserInformations(props: IProps) {
|
||||
<Typography typo={ITypo.P_SB_18}>Attribuer un titre</Typography>
|
||||
</div>
|
||||
<div className={classes["second-line"]}>
|
||||
{!isSuperAdminChecked && (
|
||||
{!isSuperAdminChecked && !currentAppointment && (
|
||||
<Switch label="Admin de son office" checked={isAdminChecked} onChange={handleAdminChanged} />
|
||||
)}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user