mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-29 07:53:23 +00:00
fix: correction de l'ouverture du dashbord [#39]
This commit is contained in:
@ -127,7 +127,12 @@ export default function Layout({
|
||||
onEstablishmentChange={(establishmentId) => {
|
||||
const parsedEstablishmentId = parseInt(establishmentId, 10);
|
||||
setSelectedEstablishmentId(parsedEstablishmentId);
|
||||
const role = session.user.roles.find(role => role.establishment__id === parsedEstablishmentId)?.role_type;
|
||||
let roleIndex = session.user.roles.findIndex(role => role.establishment__id === parsedEstablishmentId)
|
||||
if (roleIndex === -1) {
|
||||
roleIndex = 0;
|
||||
}
|
||||
setCurrentRoleIndex(roleIndex);
|
||||
const role = session.user.roles[roleIndex].role_type;
|
||||
setProfileRole(role);
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user