@go-avro/avro-js 0.0.2-beta.83 → 0.0.2-beta.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -22,6 +22,7 @@ declare module '../client/QueryClient' {
|
|
|
22
22
|
useGetJobs(companyGuid: string, body: {
|
|
23
23
|
amt?: number;
|
|
24
24
|
query?: string;
|
|
25
|
+
routeId?: string;
|
|
25
26
|
}, total: number, onProgress?: (fraction: number) => void, isMainLoad?: boolean): UseQueryResult<Job[], StandardError>;
|
|
26
27
|
useGetRoutes(companyGuid: string, body: {
|
|
27
28
|
amt?: number;
|
|
@@ -277,6 +278,7 @@ export declare class AvroQueryClient {
|
|
|
277
278
|
unknown_ids?: string[];
|
|
278
279
|
query?: string;
|
|
279
280
|
offset?: number;
|
|
281
|
+
route_id?: string;
|
|
280
282
|
}, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
281
283
|
fetchChats(companyGuid: string, body?: {
|
|
282
284
|
amt?: number;
|
|
@@ -3,7 +3,7 @@ import { AvroQueryClient } from '../../client/QueryClient';
|
|
|
3
3
|
AvroQueryClient.prototype.useGetJobs = function (companyGuid, body, total = 0, onProgress, isMainLoad = false) {
|
|
4
4
|
const queryClient = useQueryClient();
|
|
5
5
|
return useQuery({
|
|
6
|
-
queryKey: [isMainLoad ? 'main' : 'jobs', companyGuid, body.amt ?? 50, body.query ?? ""],
|
|
6
|
+
queryKey: [isMainLoad ? 'main' : 'jobs', companyGuid, body.amt ?? 50, body.query ?? "", body.routeId ?? ""],
|
|
7
7
|
queryFn: async () => {
|
|
8
8
|
if (total === 0) {
|
|
9
9
|
onProgress?.(1);
|
|
@@ -14,6 +14,7 @@ AvroQueryClient.prototype.useGetJobs = function (companyGuid, body, total = 0, o
|
|
|
14
14
|
let completed = 0;
|
|
15
15
|
const promises = Array.from({ length: pageCount }, (_, i) => this.fetchJobs(companyGuid, {
|
|
16
16
|
...body,
|
|
17
|
+
route_id: body.routeId,
|
|
17
18
|
offset: i * (body.amt ?? 0),
|
|
18
19
|
}));
|
|
19
20
|
const trackedPromises = promises.map((promise) => promise.then((result) => {
|