@@ -6,14 +6,14 @@ import { useTranslation } from '@douglasneuroinformatics/libui/hooks';
66import { $BasePermissionLevel , $CreateUserData } from '@opendatacapture/schemas/user' ;
77import type { CreateUserData , User } from '@opendatacapture/schemas/user' ;
88import { createFileRoute , useNavigate } from '@tanstack/react-router' ;
9+ import axios from 'axios' ;
910import { z } from 'zod/v4' ;
1011
1112import { PageHeader } from '@/components/PageHeader' ;
1213import { useCreateUserMutation } from '@/hooks/useCreateUserMutation' ;
1314import { groupsQueryOptions , useGroupsQuery } from '@/hooks/useGroupsQuery' ;
14- import axios from 'axios' ;
1515
16- const RouteComponent = ( ) => {
16+ const RouteComponent = async ( ) => {
1717 const { t } = useTranslation ( ) ;
1818 const navigate = useNavigate ( ) ;
1919 const groupsQuery = useGroupsQuery ( ) ;
@@ -24,6 +24,8 @@ const RouteComponent = () => {
2424 void navigate ( { to : '..' } ) ;
2525 } ;
2626
27+ const existingUsers = await axios . get ( `/v1/users` ) ;
28+
2729 return (
2830 < div >
2931 < PageHeader >
@@ -157,7 +159,6 @@ const RouteComponent = () => {
157159 } ) ;
158160 }
159161
160- const existingUsers = await axios . get ( `/v1/users` ) ;
161162 if ( existingUsers . data ) {
162163 const usersList = existingUsers . data as Omit < User , 'hashedpassword' > [ ] ;
163164
0 commit comments