diff --git a/frontend/src/routes/_layout/admin.tsx b/frontend/src/routes/_layout/admin.tsx index a53ff2c4..39241c23 100644 --- a/frontend/src/routes/_layout/admin.tsx +++ b/frontend/src/routes/_layout/admin.tsx @@ -11,7 +11,8 @@ import useAuth from "@/hooks/useAuth" function getUsersQueryOptions() { return { - queryFn: () => UsersService.readUsers({ skip: 0, limit: 100 }), + queryFn: async () => + (await UsersService.readUsers({ query: { skip: 0, limit: 100 } })).data, queryKey: ["users"], } } @@ -19,7 +20,7 @@ function getUsersQueryOptions() { export const Route = createFileRoute("/_layout/admin")({ component: Admin, beforeLoad: async () => { - const user = await UsersService.readUserMe() + const { data: user } = await UsersService.readUserMe() if (!user.is_superuser) { throw redirect({ to: "/", diff --git a/frontend/src/routes/_layout/items.tsx b/frontend/src/routes/_layout/items.tsx index a4df2000..0dbb97f9 100644 --- a/frontend/src/routes/_layout/items.tsx +++ b/frontend/src/routes/_layout/items.tsx @@ -11,7 +11,8 @@ import PendingItems from "@/components/Pending/PendingItems" function getItemsQueryOptions() { return { - queryFn: () => ItemsService.readItems({ skip: 0, limit: 100 }), + queryFn: async () => + (await ItemsService.readItems({ query: { skip: 0, limit: 100 } })).data, queryKey: ["items"], } } diff --git a/frontend/src/routes/recover-password.tsx b/frontend/src/routes/recover-password.tsx index 89ad59fa..ac19cb85 100644 --- a/frontend/src/routes/recover-password.tsx +++ b/frontend/src/routes/recover-password.tsx @@ -59,7 +59,7 @@ function RecoverPassword() { const recoverPassword = async (data: FormData) => { await LoginService.recoverPassword({ - email: data.email, + path: { email: data.email }, }) } diff --git a/frontend/src/routes/reset-password.tsx b/frontend/src/routes/reset-password.tsx index b9d5562a..bbbf3eef 100644 --- a/frontend/src/routes/reset-password.tsx +++ b/frontend/src/routes/reset-password.tsx @@ -83,7 +83,7 @@ function ResetPassword() { const mutation = useMutation({ mutationFn: (data: { new_password: string; token: string }) => - LoginService.resetPassword({ requestBody: data }), + LoginService.resetPassword({ body: data }), onSuccess: () => { showSuccessToast("Password updated successfully") form.reset()