diff --git a/src/front/Components/Layouts/Collaborators/CollaboratorInformations/index.tsx b/src/front/Components/Layouts/Collaborators/CollaboratorInformations/index.tsx index fc8b58f5..e0ee6c70 100644 --- a/src/front/Components/Layouts/Collaborators/CollaboratorInformations/index.tsx +++ b/src/front/Components/Layouts/Collaborators/CollaboratorInformations/index.tsx @@ -1,18 +1,18 @@ import ChevronIcon from "@Assets/Icons/chevron.svg"; +import OfficeRoles from "@Front/Api/LeCoffreApi/Admin/OfficeRoles/OfficeRoles"; import Users from "@Front/Api/LeCoffreApi/SuperAdmin/Users/Users"; import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button"; import CheckBox from "@Front/Components/DesignSystem/CheckBox"; import SelectField, { IOption } from "@Front/Components/DesignSystem/Form/SelectField"; import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography"; import DefaultCollaboratorDashboard from "@Front/Components/LayoutTemplates/DefaultCollaboratorDashboard"; +import Module from "@Front/Config/Module"; import User from "le-coffre-resources/dist/Notary"; import Link from "next/link"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; import classes from "./classes.module.scss"; -import Module from "@Front/Config/Module"; -import OfficeRoles from "@Front/Api/LeCoffreApi/Admin/OfficeRoles/OfficeRoles"; type IProps = {}; export default function CollaboratorInformations(props: IProps) { @@ -29,6 +29,7 @@ export default function CollaboratorInformations(props: IProps) { q: { contact: true, office_role: true, + role: true, }, }); if (!user) return; @@ -96,8 +97,8 @@ export default function CollaboratorInformations(props: IProps) { name="role" options={availableRoles} selectedOption={{ - value: userSelected?.office_role?.uid, - label: userSelected?.office_role?.name!, + value: userSelected?.office_role ? userSelected?.office_role?.uid : userSelected?.role?.uid, + label: userSelected?.office_role ? userSelected?.office_role?.name : userSelected?.role?.name!, }} /> diff --git a/src/front/Components/Layouts/Users/UserInformations/index.tsx b/src/front/Components/Layouts/Users/UserInformations/index.tsx index 13e883f4..02a9b43b 100644 --- a/src/front/Components/Layouts/Users/UserInformations/index.tsx +++ b/src/front/Components/Layouts/Users/UserInformations/index.tsx @@ -1,15 +1,16 @@ +import WarningIcon from "@Assets/images/warning.png"; +import OfficeRoles from "@Front/Api/LeCoffreApi/Admin/OfficeRoles/OfficeRoles"; import Users from "@Front/Api/LeCoffreApi/SuperAdmin/Users/Users"; import CheckBox from "@Front/Components/DesignSystem/CheckBox"; import SelectField, { IOption } from "@Front/Components/DesignSystem/Form/SelectField"; import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography"; import DefaultUserDashboard from "@Front/Components/LayoutTemplates/DefaultUserDashboard"; import User from "le-coffre-resources/dist/Notary"; +import Image from "next/image"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; + import classes from "./classes.module.scss"; -import OfficeRoles from "@Front/Api/LeCoffreApi/Admin/OfficeRoles/OfficeRoles"; -import WarningIcon from "@Assets/images/warning.png"; -import Image from "next/image"; type IProps = {}; export default function UserInformations(props: IProps) { @@ -27,6 +28,7 @@ export default function UserInformations(props: IProps) { contact: true, office_role: true, office_membership: true, + role: true, }, }); if (!user) return; @@ -87,8 +89,8 @@ export default function UserInformations(props: IProps) { name="role" options={availableRoles} selectedOption={{ - value: userSelected?.office_role?.uid, - label: userSelected?.office_role?.name!, + value: userSelected?.office_role ? userSelected?.office_role?.uid : userSelected?.role?.uid, + label: userSelected?.office_role ? userSelected?.office_role?.name : userSelected?.role?.name!, }} />