@go-avro/avro-js 0.0.2-beta.130 → 0.0.2-beta.132
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.
- package/dist/client/hooks/bills.js +1 -0
- package/dist/client/hooks/events.js +1 -0
- package/dist/client/hooks/jobs.js +2 -5
- package/dist/client/hooks/months.js +1 -0
- package/dist/client/hooks/routes.js +2 -2
- package/dist/client/hooks/skills.js +3 -2
- package/dist/client/hooks/teams.js +2 -1
- package/dist/types/api.d.ts +1 -0
- package/package.json +1 -1
|
@@ -66,6 +66,7 @@ AvroQueryClient.prototype.useCreateBill = function () {
|
|
|
66
66
|
queryClient.invalidateQueries({ queryKey: ['bills', this.companyId] });
|
|
67
67
|
queryClient.invalidateQueries({ queryKey: ['events', this.companyId] });
|
|
68
68
|
queryClient.invalidateQueries({ queryKey: ['months', this.companyId] });
|
|
69
|
+
queryClient.invalidateQueries({ queryKey: ['company'] });
|
|
69
70
|
},
|
|
70
71
|
});
|
|
71
72
|
};
|
|
@@ -121,6 +121,7 @@ AvroQueryClient.prototype.useCreateEvent = function () {
|
|
|
121
121
|
queryClient.invalidateQueries({ queryKey: ['events'] });
|
|
122
122
|
queryClient.invalidateQueries({ queryKey: ['job'] });
|
|
123
123
|
queryClient.invalidateQueries({ queryKey: ['jobs'] });
|
|
124
|
+
queryClient.invalidateQueries({ queryKey: ['company'] });
|
|
124
125
|
},
|
|
125
126
|
});
|
|
126
127
|
};
|
|
@@ -10,12 +10,8 @@ AvroQueryClient.prototype.useGetJobs = function (onProgress) {
|
|
|
10
10
|
return useQuery({
|
|
11
11
|
queryKey: ['jobs', this.companyId, this.company?.num_jobs],
|
|
12
12
|
queryFn: async () => {
|
|
13
|
-
if (this.company?.num_jobs === 0) {
|
|
14
|
-
onProgress?.(1);
|
|
15
|
-
return [];
|
|
16
|
-
}
|
|
17
13
|
onProgress?.(0);
|
|
18
|
-
const pageCount = amt ? Math.ceil((this.company?.num_jobs ?? 0) / amt) :
|
|
14
|
+
const pageCount = amt ? Math.ceil((this.company?.num_jobs ?? 0) / amt) : 1;
|
|
19
15
|
let completed = 0;
|
|
20
16
|
const promises = Array.from({ length: pageCount }, (_, i) => this.fetchJobs({ offset: i * amt, amt }));
|
|
21
17
|
const trackedPromises = promises.map((promise) => promise.then((result) => {
|
|
@@ -117,6 +113,7 @@ AvroQueryClient.prototype.useCreateJob = function () {
|
|
|
117
113
|
const { id: jobId } = data ?? {};
|
|
118
114
|
queryClient.invalidateQueries({ queryKey: ['jobs'] });
|
|
119
115
|
queryClient.invalidateQueries({ queryKey: ['job', jobId] });
|
|
116
|
+
queryClient.invalidateQueries({ queryKey: ['company'] });
|
|
120
117
|
},
|
|
121
118
|
});
|
|
122
119
|
};
|
|
@@ -87,6 +87,7 @@ AvroQueryClient.prototype.useUpdateMonths = function () {
|
|
|
87
87
|
onSettled: () => {
|
|
88
88
|
queryClient.invalidateQueries({ queryKey: ['months'] });
|
|
89
89
|
queryClient.invalidateQueries({ queryKey: ['month'] });
|
|
90
|
+
queryClient.invalidateQueries({ queryKey: ['company'] });
|
|
90
91
|
},
|
|
91
92
|
});
|
|
92
93
|
};
|
|
@@ -8,7 +8,7 @@ AvroQueryClient.prototype.useGetRoutes = function (body, total, onProgress) {
|
|
|
8
8
|
return this.fetchRoutes({ ...body, offset: 0 });
|
|
9
9
|
}
|
|
10
10
|
onProgress?.(0);
|
|
11
|
-
const pageCount = body.amt ? Math.ceil(total / body.amt) :
|
|
11
|
+
const pageCount = body.amt ? Math.ceil(total / body.amt) : 1;
|
|
12
12
|
let completed = 0;
|
|
13
13
|
const promises = Array.from({ length: pageCount }, (_, i) => this.fetchRoutes({
|
|
14
14
|
...body,
|
|
@@ -71,7 +71,7 @@ AvroQueryClient.prototype.useCreateRoute = function () {
|
|
|
71
71
|
queryClient.invalidateQueries({ queryKey: ['routes'] });
|
|
72
72
|
queryClient.invalidateQueries({ queryKey: ['jobs'] });
|
|
73
73
|
queryClient.invalidateQueries({ queryKey: ['job'] });
|
|
74
|
-
queryClient.invalidateQueries({ queryKey: ['company'
|
|
74
|
+
queryClient.invalidateQueries({ queryKey: ['company'] });
|
|
75
75
|
},
|
|
76
76
|
});
|
|
77
77
|
};
|
|
@@ -9,7 +9,8 @@ AvroQueryClient.prototype.useCreateSkill = function () {
|
|
|
9
9
|
});
|
|
10
10
|
},
|
|
11
11
|
onSettled: () => {
|
|
12
|
-
queryClient.invalidateQueries({ queryKey: ['
|
|
12
|
+
queryClient.invalidateQueries({ queryKey: ['company'] });
|
|
13
|
+
queryClient.invalidateQueries({ queryKey: ['skills'] });
|
|
13
14
|
},
|
|
14
15
|
});
|
|
15
16
|
};
|
|
@@ -21,7 +22,7 @@ AvroQueryClient.prototype.useGetSkills = function (body, total, onProgress) {
|
|
|
21
22
|
return this.fetchSkills({ ...body, offset: 0 });
|
|
22
23
|
}
|
|
23
24
|
onProgress?.(0);
|
|
24
|
-
const pageCount = body.amt ? Math.ceil(total / body.amt) :
|
|
25
|
+
const pageCount = body.amt ? Math.ceil(total / body.amt) : 1;
|
|
25
26
|
let completed = 0;
|
|
26
27
|
const promises = Array.from({ length: pageCount }, (_, i) => this.fetchSkills({
|
|
27
28
|
...body,
|
|
@@ -8,7 +8,7 @@ AvroQueryClient.prototype.useGetTeams = function (body, total, onProgress) {
|
|
|
8
8
|
return this.fetchTeams({ ...body, offset: 0 });
|
|
9
9
|
}
|
|
10
10
|
onProgress?.(0);
|
|
11
|
-
const pageCount = body.amt ? Math.ceil(total / body.amt) :
|
|
11
|
+
const pageCount = body.amt ? Math.ceil(total / body.amt) : 1;
|
|
12
12
|
let completed = 0;
|
|
13
13
|
const promises = Array.from({ length: pageCount }, (_, i) => this.fetchTeams({
|
|
14
14
|
...body,
|
|
@@ -33,6 +33,7 @@ AvroQueryClient.prototype.useCreateTeam = function () {
|
|
|
33
33
|
return this.post(`/company/${this.companyId}/team`, JSON.stringify(teamData), undefined, { "Content-Type": "application/json" });
|
|
34
34
|
},
|
|
35
35
|
onSettled: () => {
|
|
36
|
+
queryClient.invalidateQueries({ queryKey: ['company'] });
|
|
36
37
|
queryClient.invalidateQueries({ queryKey: ['teams'] });
|
|
37
38
|
},
|
|
38
39
|
});
|
package/dist/types/api.d.ts
CHANGED