@go-avro/avro-js 0.0.76 → 0.0.77
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/routes.js +8 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { useMutation, useQuery } from '@tanstack/react-query';
|
|
2
2
|
import { AvroQueryClient } from '../../client/QueryClient';
|
|
3
3
|
import { Route } from '../../types/api';
|
|
4
|
+
const dedupeJobTasks = (payload) => payload.jobs
|
|
5
|
+
? {
|
|
6
|
+
...payload,
|
|
7
|
+
jobs: payload.jobs.map((job) => job.tasks ? { ...job, tasks: [...new Set(job.tasks)] } : job),
|
|
8
|
+
}
|
|
9
|
+
: payload;
|
|
4
10
|
AvroQueryClient.prototype.useGetRoutes = function (body, total, onProgress) {
|
|
5
11
|
return useQuery({
|
|
6
12
|
queryKey: ['routes', this.companyId, body.amt ?? 50, body.query ?? '', total ?? 'all'],
|
|
@@ -45,7 +51,7 @@ AvroQueryClient.prototype.useCreateRoute = function () {
|
|
|
45
51
|
mutationFn: async ({ routeData }) => {
|
|
46
52
|
return this.post({
|
|
47
53
|
path: `/company/${this.companyId}/route`,
|
|
48
|
-
data: JSON.stringify(routeData),
|
|
54
|
+
data: JSON.stringify(dedupeJobTasks(routeData)),
|
|
49
55
|
headers: { 'Content-Type': 'application/json' },
|
|
50
56
|
});
|
|
51
57
|
},
|
|
@@ -134,7 +140,7 @@ AvroQueryClient.prototype.useUpdateRoute = function () {
|
|
|
134
140
|
mutationFn: async ({ routeId, updates, }) => {
|
|
135
141
|
return this.put({
|
|
136
142
|
path: `/route/${routeId}`,
|
|
137
|
-
data: JSON.stringify(updates),
|
|
143
|
+
data: JSON.stringify(dedupeJobTasks(updates)),
|
|
138
144
|
headers: { 'Content-Type': 'application/json' },
|
|
139
145
|
});
|
|
140
146
|
},
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AVRO_JS_VERSION = "0.0.
|
|
1
|
+
export declare const AVRO_JS_VERSION = "0.0.77";
|
package/dist/version.js
CHANGED