diff --git a/src/App.tsx b/src/App.tsx index 523a30de..e34dd1a2 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -14,7 +14,6 @@ import EditPreselectionForm from "src/pages/preselectionForms/edit"; import { setupStore } from "src/store"; import { PageTemplate } from "./features/PageTemplate"; import SentryWrapper from "./features/SentryWrapper"; -import Jotform from "./pages/Jotform"; import Prospect from "./pages/Prospect"; import UxDashboard from "./pages/UxDashboard"; import AgreementsList from "./pages/agreements/list"; @@ -50,17 +49,16 @@ function App() { path="/backoffice/payments" component={AdminPayments} /> - = ({ children, excludeRule, isFluid }) => { - const { isFetching, isError, isLoading } = useUserData(); + const { isError, isFetching, isLoading } = useGetUsersMeQuery({ + fields: "role", + }); if (isLoading || isFetching) return loading...; if (isError) return there was an error; if (excludeRule) @@ -23,7 +25,9 @@ export const AuthorizedOnlyContainer: React.FC<{ export const OpsUserContainer: React.FC<{ children: React.ReactNode }> = ({ children, }) => { - const { data } = useUserData(); + const { data } = useGetUsersMeQuery({ + fields: "role", + }); return ( { + const selectOptions = useMemo( + () => + options.map((option) => ({ + label: option.label, + value: option.value, + })), + [options] + ); + return ( +
+ { + if (!value || !value.length) { + return "This is a required field"; + } + }} + > + {({ + field, // { name, value, onChange, onBlur } + form, + }: FieldProps) => { + return ( + +