mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-14 19:22:14 +01:00
add dynamic loading of paginated endpoints above page_limit
add request classes and fix collection typing for clients, tasks and tags
This commit is contained in:
12
resources/js/utils/useReportsQuery.ts
Normal file
12
resources/js/utils/useReportsQuery.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { api } from '@/packages/api/src';
|
||||
import type { Report } from '@/packages/api/src';
|
||||
import { fetchAllPages } from '@/utils/fetchAllPages';
|
||||
|
||||
export async function fetchAllReports(organizationId: string): Promise<Report[]> {
|
||||
return fetchAllPages((page) =>
|
||||
api.getReports({
|
||||
params: { organization: organizationId },
|
||||
queries: { page },
|
||||
})
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user