Added paging to accounts table

This commit is contained in:
2025-03-02 20:45:44 -05:00
parent d06d421d03
commit 7c3b462651
14 changed files with 266 additions and 67 deletions

View File

@@ -28,6 +28,24 @@ export function useGetAccounts(page: number, pageSize: number, searchTerm?: stri
});
}
export function useGetAccountsCount(){
return useQuery({
queryKey: [ "accounts", "count"],
queryFn: async () => {
const response = await api.get("/account/count");
if(response.status !== 200){
throw new Error("Failed to get accounts count");
}
else if(response.data.errors){
throw new Error(response.data.errors.join(", "));
}
return response.data.count as number;
}
});
}
export function useForcePasswordReset(accountId: string){
const queryClient = useQueryClient();