@go-avro/avro-js 0.0.2-beta.70 → 0.0.2-beta.71
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.
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
2
2
|
import { AvroQueryClient } from '../../client/QueryClient';
|
|
3
|
-
AvroQueryClient.prototype.useGetRoutes = function (companyGuid, body, total
|
|
4
|
-
const queryClient = useQueryClient();
|
|
3
|
+
AvroQueryClient.prototype.useGetRoutes = function (companyGuid, body, total, onProgress) {
|
|
5
4
|
return useQuery({
|
|
6
5
|
queryKey: ['routes', companyGuid, body.amt ?? 50, body.query ?? ""],
|
|
7
6
|
queryFn: async () => {
|
|
8
|
-
if (total
|
|
9
|
-
|
|
10
|
-
return [];
|
|
7
|
+
if (typeof total !== "number") {
|
|
8
|
+
return this.fetchRoutes(companyGuid, { ...body, offset: 0 });
|
|
11
9
|
}
|
|
12
10
|
onProgress?.(0);
|
|
13
11
|
const pageCount = body.amt ? Math.ceil(total / body.amt) : 0;
|
|
@@ -26,7 +24,7 @@ AvroQueryClient.prototype.useGetRoutes = function (companyGuid, body, total = 0,
|
|
|
26
24
|
const routes = pages.flat();
|
|
27
25
|
return routes;
|
|
28
26
|
},
|
|
29
|
-
enabled: Boolean(companyGuid) && companyGuid.length > 0
|
|
27
|
+
enabled: Boolean(companyGuid) && companyGuid.length > 0,
|
|
30
28
|
});
|
|
31
29
|
};
|
|
32
30
|
AvroQueryClient.prototype.useGetRoute = function (routeId) {
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { AvroQueryClient } from "../../client/QueryClient";
|
|
2
2
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
3
|
-
AvroQueryClient.prototype.useGetTeams = function (companyGuid, body, total
|
|
4
|
-
const queryClient = useQueryClient();
|
|
3
|
+
AvroQueryClient.prototype.useGetTeams = function (companyGuid, body, total, onProgress) {
|
|
5
4
|
return useQuery({
|
|
6
5
|
queryKey: ['teams', companyGuid, body.amt ?? 50, body.query ?? ""],
|
|
7
6
|
queryFn: async () => {
|
|
8
|
-
if (total
|
|
9
|
-
|
|
10
|
-
return [];
|
|
7
|
+
if (typeof total !== "number") {
|
|
8
|
+
return this.fetchTeams(companyGuid, { ...body, offset: 0 });
|
|
11
9
|
}
|
|
12
10
|
onProgress?.(0);
|
|
13
11
|
const pageCount = body.amt ? Math.ceil(total / body.amt) : 0;
|
|
@@ -26,7 +24,7 @@ AvroQueryClient.prototype.useGetTeams = function (companyGuid, body, total = 0,
|
|
|
26
24
|
const routes = pages.flat();
|
|
27
25
|
return routes;
|
|
28
26
|
},
|
|
29
|
-
enabled: Boolean(companyGuid) && companyGuid.length > 0
|
|
27
|
+
enabled: Boolean(companyGuid) && companyGuid.length > 0,
|
|
30
28
|
});
|
|
31
29
|
};
|
|
32
30
|
AvroQueryClient.prototype.useDeleteTeam = function () {
|
package/dist/types/api.d.ts
CHANGED
|
@@ -351,14 +351,9 @@ export interface PlanPayment {
|
|
|
351
351
|
time_updated: number;
|
|
352
352
|
}
|
|
353
353
|
export interface Company {
|
|
354
|
-
events: _Event[];
|
|
355
|
-
months: ServiceMonth[];
|
|
356
354
|
id: string;
|
|
357
|
-
jobs: Job[];
|
|
358
355
|
name: string;
|
|
359
356
|
email: string;
|
|
360
|
-
routes: Route[];
|
|
361
|
-
teams: Team[];
|
|
362
357
|
emails: Email[];
|
|
363
358
|
skills: Skill[];
|
|
364
359
|
time_created: number;
|
|
@@ -381,6 +376,8 @@ export interface Company {
|
|
|
381
376
|
billing_email_id: string;
|
|
382
377
|
num_events: number;
|
|
383
378
|
num_jobs: number;
|
|
379
|
+
num_routes: number;
|
|
380
|
+
num_teams: number;
|
|
384
381
|
bills: Bill[];
|
|
385
382
|
enabled_payment_methods: string[];
|
|
386
383
|
sessions: Session[];
|