Added paging to accounts table
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user