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