Skip to content

Commit 9e3ea65

Browse files
committed
fix: find list of usernames before ctx usage
1 parent e5fb9da commit 9e3ea65

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

apps/api/src/sessions/sessions.service.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export class SessionsService {
4141
username: username
4242
}
4343
});
44-
// user = await this.userService.findById(userId);
4544
}
4645

4746
// If the subject is not yet associated with the group, check it exists then append it

apps/web/src/routes/_app/admin/users/create.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ import { useTranslation } from '@douglasneuroinformatics/libui/hooks';
66
import { $BasePermissionLevel, $CreateUserData } from '@opendatacapture/schemas/user';
77
import type { CreateUserData, User } from '@opendatacapture/schemas/user';
88
import { createFileRoute, useNavigate } from '@tanstack/react-router';
9+
import axios from 'axios';
910
import { z } from 'zod/v4';
1011

1112
import { PageHeader } from '@/components/PageHeader';
1213
import { useCreateUserMutation } from '@/hooks/useCreateUserMutation';
1314
import { 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

Comments
 (0)