@squonk/account-server-client 0.1.24-rc.1 → 0.1.27-rc.1
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/{custom-instance-4a108741.d.ts → account-server-api.schemas-e6c5f956.d.ts} +15 -20
- package/{chunk-JR7F532L.js → chunk-GWBPVOL2.js} +2 -23
- package/chunk-GWBPVOL2.js.map +1 -0
- package/chunk-N3RLW53G.cjs +25 -0
- package/chunk-N3RLW53G.cjs.map +1 -0
- package/index.cjs +21 -5
- package/index.cjs.map +1 -1
- package/index.d.ts +20 -2
- package/index.js +21 -5
- package/index.js.map +1 -1
- package/organisation/organisation.cjs +31 -31
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.ts +37 -28
- package/organisation/organisation.js +38 -38
- package/organisation/organisation.js.map +1 -1
- package/package.json +14 -14
- package/product/product.cjs +64 -61
- package/product/product.cjs.map +1 -1
- package/product/product.d.ts +70 -40
- package/product/product.js +75 -72
- package/product/product.js.map +1 -1
- package/service/service.cjs +23 -21
- package/service/service.cjs.map +1 -1
- package/service/service.d.ts +19 -15
- package/service/service.js +26 -24
- package/service/service.js.map +1 -1
- package/src/account-server-api.schemas.ts +14 -1
- package/src/organisation/organisation.ts +86 -83
- package/src/product/product.ts +210 -145
- package/src/service/service.ts +64 -56
- package/src/state/state.ts +31 -32
- package/src/unit/unit.ts +170 -149
- package/src/user/user.ts +171 -160
- package/state/state.cjs +12 -12
- package/state/state.cjs.map +1 -1
- package/state/state.d.ts +12 -10
- package/state/state.js +13 -13
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +54 -58
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.ts +64 -49
- package/unit/unit.js +67 -71
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +56 -56
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +69 -55
- package/user/user.js +69 -69
- package/user/user.js.map +1 -1
- package/chunk-3DXYUDZH.cjs +0 -46
- package/chunk-3DXYUDZH.cjs.map +0 -1
- package/chunk-JR7F532L.js.map +0 -1
package/src/unit/unit.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by orval v6.
|
|
2
|
+
* Generated by orval v6.7.1 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Account Server API
|
|
5
5
|
* The Informatics Matters Account Server API.
|
|
@@ -8,6 +8,7 @@ A service that provides access to the Account Server, which gives *registered* u
|
|
|
8
8
|
|
|
9
9
|
* OpenAPI spec version: 0.1
|
|
10
10
|
*/
|
|
11
|
+
import axios, { AxiosRequestConfig, AxiosResponse, AxiosError } from "axios";
|
|
11
12
|
import {
|
|
12
13
|
useQuery,
|
|
13
14
|
useMutation,
|
|
@@ -27,7 +28,6 @@ import type {
|
|
|
27
28
|
UnitsGetResponse,
|
|
28
29
|
PersonalUnitPutResponse,
|
|
29
30
|
} from "../account-server-api.schemas";
|
|
30
|
-
import { customInstance, ErrorType } from ".././custom-instance";
|
|
31
31
|
|
|
32
32
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
33
|
type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (
|
|
@@ -36,61 +36,55 @@ type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (
|
|
|
36
36
|
? R
|
|
37
37
|
: any;
|
|
38
38
|
|
|
39
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
|
-
type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
41
|
-
config: any,
|
|
42
|
-
args: infer P
|
|
43
|
-
) => any
|
|
44
|
-
? P
|
|
45
|
-
: never;
|
|
46
|
-
|
|
47
39
|
/**
|
|
48
|
-
* Gets Organisational Units you have access to
|
|
40
|
+
* Gets Organisational Units you have access to or that are public
|
|
49
41
|
|
|
50
42
|
* @summary Gets Organisational Units
|
|
51
43
|
*/
|
|
52
|
-
export const
|
|
53
|
-
|
|
54
|
-
options?:
|
|
55
|
-
) => {
|
|
56
|
-
return
|
|
57
|
-
{ url: `/organisation/${orgid}/unit`, method: "get" },
|
|
58
|
-
options
|
|
59
|
-
);
|
|
44
|
+
export const appApiUnitGetOrgUnits = (
|
|
45
|
+
orgId: string,
|
|
46
|
+
options?: AxiosRequestConfig
|
|
47
|
+
): Promise<AxiosResponse<OrganisationUnitsGetResponse>> => {
|
|
48
|
+
return axios.get(`/organisation/${orgId}/unit`, options);
|
|
60
49
|
};
|
|
61
50
|
|
|
62
|
-
export const
|
|
63
|
-
`/organisation/${
|
|
51
|
+
export const getAppApiUnitGetOrgUnitsQueryKey = (orgId: string) => [
|
|
52
|
+
`/organisation/${orgId}/unit`,
|
|
64
53
|
];
|
|
65
54
|
|
|
66
|
-
export
|
|
67
|
-
|
|
68
|
-
|
|
55
|
+
export type AppApiUnitGetOrgUnitsQueryResult = NonNullable<
|
|
56
|
+
AsyncReturnType<typeof appApiUnitGetOrgUnits>
|
|
57
|
+
>;
|
|
58
|
+
export type AppApiUnitGetOrgUnitsQueryError = AxiosError<void | AsError>;
|
|
59
|
+
|
|
60
|
+
export const useAppApiUnitGetOrgUnits = <
|
|
61
|
+
TData = AsyncReturnType<typeof appApiUnitGetOrgUnits>,
|
|
62
|
+
TError = AxiosError<void | AsError>
|
|
69
63
|
>(
|
|
70
|
-
|
|
64
|
+
orgId: string,
|
|
71
65
|
options?: {
|
|
72
66
|
query?: UseQueryOptions<
|
|
73
|
-
AsyncReturnType<typeof
|
|
67
|
+
AsyncReturnType<typeof appApiUnitGetOrgUnits>,
|
|
74
68
|
TError,
|
|
75
69
|
TData
|
|
76
70
|
>;
|
|
77
|
-
|
|
71
|
+
axios?: AxiosRequestConfig;
|
|
78
72
|
}
|
|
79
73
|
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
80
|
-
const { query: queryOptions,
|
|
74
|
+
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
81
75
|
|
|
82
76
|
const queryKey =
|
|
83
|
-
queryOptions?.queryKey ??
|
|
77
|
+
queryOptions?.queryKey ?? getAppApiUnitGetOrgUnitsQueryKey(orgId);
|
|
84
78
|
|
|
85
79
|
const queryFn: QueryFunction<
|
|
86
|
-
AsyncReturnType<typeof
|
|
87
|
-
> = () =>
|
|
80
|
+
AsyncReturnType<typeof appApiUnitGetOrgUnits>
|
|
81
|
+
> = () => appApiUnitGetOrgUnits(orgId, axiosOptions);
|
|
88
82
|
|
|
89
83
|
const query = useQuery<
|
|
90
|
-
AsyncReturnType<typeof
|
|
84
|
+
AsyncReturnType<typeof appApiUnitGetOrgUnits>,
|
|
91
85
|
TError,
|
|
92
86
|
TData
|
|
93
|
-
>(queryKey, queryFn, { enabled: !!
|
|
87
|
+
>(queryKey, queryFn, { enabled: !!orgId, ...queryOptions });
|
|
94
88
|
|
|
95
89
|
return {
|
|
96
90
|
queryKey,
|
|
@@ -103,94 +97,105 @@ export const useGetOrganisationUnits = <
|
|
|
103
97
|
|
|
104
98
|
* @summary Create a new Organisational Unit
|
|
105
99
|
*/
|
|
106
|
-
export const
|
|
107
|
-
|
|
100
|
+
export const appApiUnitPost = (
|
|
101
|
+
orgId: string,
|
|
108
102
|
organisationUnitPostBodyBody: OrganisationUnitPostBodyBody,
|
|
109
|
-
options?:
|
|
110
|
-
) => {
|
|
111
|
-
return
|
|
112
|
-
{
|
|
113
|
-
|
|
114
|
-
method: "post",
|
|
115
|
-
data: organisationUnitPostBodyBody,
|
|
116
|
-
},
|
|
103
|
+
options?: AxiosRequestConfig
|
|
104
|
+
): Promise<AxiosResponse<OrganisationUnitPostResponse>> => {
|
|
105
|
+
return axios.post(
|
|
106
|
+
`/organisation/${orgId}/unit`,
|
|
107
|
+
organisationUnitPostBodyBody,
|
|
117
108
|
options
|
|
118
109
|
);
|
|
119
110
|
};
|
|
120
111
|
|
|
121
|
-
export
|
|
122
|
-
|
|
112
|
+
export type AppApiUnitPostMutationResult = NonNullable<
|
|
113
|
+
AsyncReturnType<typeof appApiUnitPost>
|
|
114
|
+
>;
|
|
115
|
+
export type AppApiUnitPostMutationBody = OrganisationUnitPostBodyBody;
|
|
116
|
+
export type AppApiUnitPostMutationError = AxiosError<AsError | void>;
|
|
117
|
+
|
|
118
|
+
export const useAppApiUnitPost = <
|
|
119
|
+
TError = AxiosError<AsError | void>,
|
|
123
120
|
TContext = unknown
|
|
124
121
|
>(options?: {
|
|
125
122
|
mutation?: UseMutationOptions<
|
|
126
|
-
AsyncReturnType<typeof
|
|
123
|
+
AsyncReturnType<typeof appApiUnitPost>,
|
|
127
124
|
TError,
|
|
128
|
-
{
|
|
125
|
+
{ orgId: string; data: OrganisationUnitPostBodyBody },
|
|
129
126
|
TContext
|
|
130
127
|
>;
|
|
131
|
-
|
|
128
|
+
axios?: AxiosRequestConfig;
|
|
132
129
|
}) => {
|
|
133
|
-
const { mutation: mutationOptions,
|
|
130
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options || {};
|
|
134
131
|
|
|
135
132
|
const mutationFn: MutationFunction<
|
|
136
|
-
AsyncReturnType<typeof
|
|
137
|
-
{
|
|
133
|
+
AsyncReturnType<typeof appApiUnitPost>,
|
|
134
|
+
{ orgId: string; data: OrganisationUnitPostBodyBody }
|
|
138
135
|
> = (props) => {
|
|
139
|
-
const {
|
|
136
|
+
const { orgId, data } = props || {};
|
|
140
137
|
|
|
141
|
-
return
|
|
138
|
+
return appApiUnitPost(orgId, data, axiosOptions);
|
|
142
139
|
};
|
|
143
140
|
|
|
144
141
|
return useMutation<
|
|
145
|
-
AsyncReturnType<typeof
|
|
142
|
+
AsyncReturnType<typeof appApiUnitPost>,
|
|
146
143
|
TError,
|
|
147
|
-
{
|
|
144
|
+
{ orgId: string; data: OrganisationUnitPostBodyBody },
|
|
148
145
|
TContext
|
|
149
146
|
>(mutationFn, mutationOptions);
|
|
150
147
|
};
|
|
151
148
|
/**
|
|
152
|
-
* Gets the Unit, assuming you are a member of it. Admin users can see all Units
|
|
149
|
+
* Gets the Unit, assuming you are a member of it or it is public. Admin users can see all Units
|
|
153
150
|
|
|
154
151
|
* @summary Gets a Unit
|
|
155
152
|
*/
|
|
156
|
-
export const
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
options?:
|
|
160
|
-
) => {
|
|
161
|
-
return
|
|
162
|
-
{ url: `/organisation/${orgid}/unit/${unitid}`, method: "get" },
|
|
163
|
-
options
|
|
164
|
-
);
|
|
153
|
+
export const appApiUnitGetUnit = (
|
|
154
|
+
orgId: string,
|
|
155
|
+
unitId: string,
|
|
156
|
+
options?: AxiosRequestConfig
|
|
157
|
+
): Promise<AxiosResponse<UnitGetResponse>> => {
|
|
158
|
+
return axios.get(`/organisation/${orgId}/unit/${unitId}`, options);
|
|
165
159
|
};
|
|
166
160
|
|
|
167
|
-
export const
|
|
168
|
-
`/organisation/${
|
|
161
|
+
export const getAppApiUnitGetUnitQueryKey = (orgId: string, unitId: string) => [
|
|
162
|
+
`/organisation/${orgId}/unit/${unitId}`,
|
|
169
163
|
];
|
|
170
164
|
|
|
171
|
-
export
|
|
172
|
-
|
|
173
|
-
|
|
165
|
+
export type AppApiUnitGetUnitQueryResult = NonNullable<
|
|
166
|
+
AsyncReturnType<typeof appApiUnitGetUnit>
|
|
167
|
+
>;
|
|
168
|
+
export type AppApiUnitGetUnitQueryError = AxiosError<void | AsError>;
|
|
169
|
+
|
|
170
|
+
export const useAppApiUnitGetUnit = <
|
|
171
|
+
TData = AsyncReturnType<typeof appApiUnitGetUnit>,
|
|
172
|
+
TError = AxiosError<void | AsError>
|
|
174
173
|
>(
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
orgId: string,
|
|
175
|
+
unitId: string,
|
|
177
176
|
options?: {
|
|
178
|
-
query?: UseQueryOptions<
|
|
179
|
-
|
|
177
|
+
query?: UseQueryOptions<
|
|
178
|
+
AsyncReturnType<typeof appApiUnitGetUnit>,
|
|
179
|
+
TError,
|
|
180
|
+
TData
|
|
181
|
+
>;
|
|
182
|
+
axios?: AxiosRequestConfig;
|
|
180
183
|
}
|
|
181
184
|
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
182
|
-
const { query: queryOptions,
|
|
185
|
+
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
183
186
|
|
|
184
|
-
const queryKey =
|
|
187
|
+
const queryKey =
|
|
188
|
+
queryOptions?.queryKey ?? getAppApiUnitGetUnitQueryKey(orgId, unitId);
|
|
185
189
|
|
|
186
|
-
const queryFn: QueryFunction<
|
|
187
|
-
|
|
190
|
+
const queryFn: QueryFunction<
|
|
191
|
+
AsyncReturnType<typeof appApiUnitGetUnit>
|
|
192
|
+
> = () => appApiUnitGetUnit(orgId, unitId, axiosOptions);
|
|
188
193
|
|
|
189
|
-
const query = useQuery<
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
);
|
|
194
|
+
const query = useQuery<
|
|
195
|
+
AsyncReturnType<typeof appApiUnitGetUnit>,
|
|
196
|
+
TError,
|
|
197
|
+
TData
|
|
198
|
+
>(queryKey, queryFn, { enabled: !!(orgId && unitId), ...queryOptions });
|
|
194
199
|
|
|
195
200
|
return {
|
|
196
201
|
queryKey,
|
|
@@ -203,76 +208,83 @@ export const useGetUnit = <
|
|
|
203
208
|
|
|
204
209
|
* @summary Deletes an Organisational Unit
|
|
205
210
|
*/
|
|
206
|
-
export const
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
options?:
|
|
210
|
-
) => {
|
|
211
|
-
return
|
|
212
|
-
{ url: `/organisation/${orgid}/unit/${unitid}`, method: "delete" },
|
|
213
|
-
options
|
|
214
|
-
);
|
|
211
|
+
export const appApiUnitDelete = (
|
|
212
|
+
orgId: string,
|
|
213
|
+
unitId: string,
|
|
214
|
+
options?: AxiosRequestConfig
|
|
215
|
+
): Promise<AxiosResponse<void>> => {
|
|
216
|
+
return axios.delete(`/organisation/${orgId}/unit/${unitId}`, options);
|
|
215
217
|
};
|
|
216
218
|
|
|
217
|
-
export
|
|
218
|
-
|
|
219
|
+
export type AppApiUnitDeleteMutationResult = NonNullable<
|
|
220
|
+
AsyncReturnType<typeof appApiUnitDelete>
|
|
221
|
+
>;
|
|
222
|
+
|
|
223
|
+
export type AppApiUnitDeleteMutationError = AxiosError<AsError>;
|
|
224
|
+
|
|
225
|
+
export const useAppApiUnitDelete = <
|
|
226
|
+
TError = AxiosError<AsError>,
|
|
219
227
|
TContext = unknown
|
|
220
228
|
>(options?: {
|
|
221
229
|
mutation?: UseMutationOptions<
|
|
222
|
-
AsyncReturnType<typeof
|
|
230
|
+
AsyncReturnType<typeof appApiUnitDelete>,
|
|
223
231
|
TError,
|
|
224
|
-
{
|
|
232
|
+
{ orgId: string; unitId: string },
|
|
225
233
|
TContext
|
|
226
234
|
>;
|
|
227
|
-
|
|
235
|
+
axios?: AxiosRequestConfig;
|
|
228
236
|
}) => {
|
|
229
|
-
const { mutation: mutationOptions,
|
|
237
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options || {};
|
|
230
238
|
|
|
231
239
|
const mutationFn: MutationFunction<
|
|
232
|
-
AsyncReturnType<typeof
|
|
233
|
-
{
|
|
240
|
+
AsyncReturnType<typeof appApiUnitDelete>,
|
|
241
|
+
{ orgId: string; unitId: string }
|
|
234
242
|
> = (props) => {
|
|
235
|
-
const {
|
|
243
|
+
const { orgId, unitId } = props || {};
|
|
236
244
|
|
|
237
|
-
return
|
|
245
|
+
return appApiUnitDelete(orgId, unitId, axiosOptions);
|
|
238
246
|
};
|
|
239
247
|
|
|
240
248
|
return useMutation<
|
|
241
|
-
AsyncReturnType<typeof
|
|
249
|
+
AsyncReturnType<typeof appApiUnitDelete>,
|
|
242
250
|
TError,
|
|
243
|
-
{
|
|
251
|
+
{ orgId: string; unitId: string },
|
|
244
252
|
TContext
|
|
245
253
|
>(mutationFn, mutationOptions);
|
|
246
254
|
};
|
|
247
255
|
/**
|
|
248
|
-
* Gets all the Units you are a member of. Admin users can see all Units
|
|
256
|
+
* Gets all the Units that are public or you are a member of. Admin users can see all Units
|
|
249
257
|
|
|
250
|
-
* @summary Gets Units
|
|
258
|
+
* @summary Gets Units
|
|
251
259
|
*/
|
|
252
|
-
export const
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
);
|
|
260
|
+
export const appApiUnitGet = (
|
|
261
|
+
options?: AxiosRequestConfig
|
|
262
|
+
): Promise<AxiosResponse<UnitsGetResponse>> => {
|
|
263
|
+
return axios.get(`/unit`, options);
|
|
257
264
|
};
|
|
258
265
|
|
|
259
|
-
export const
|
|
266
|
+
export const getAppApiUnitGetQueryKey = () => [`/unit`];
|
|
267
|
+
|
|
268
|
+
export type AppApiUnitGetQueryResult = NonNullable<
|
|
269
|
+
AsyncReturnType<typeof appApiUnitGet>
|
|
270
|
+
>;
|
|
271
|
+
export type AppApiUnitGetQueryError = AxiosError<void | AsError>;
|
|
260
272
|
|
|
261
|
-
export const
|
|
262
|
-
TData = AsyncReturnType<typeof
|
|
263
|
-
TError =
|
|
273
|
+
export const useAppApiUnitGet = <
|
|
274
|
+
TData = AsyncReturnType<typeof appApiUnitGet>,
|
|
275
|
+
TError = AxiosError<void | AsError>
|
|
264
276
|
>(options?: {
|
|
265
|
-
query?: UseQueryOptions<AsyncReturnType<typeof
|
|
266
|
-
|
|
277
|
+
query?: UseQueryOptions<AsyncReturnType<typeof appApiUnitGet>, TError, TData>;
|
|
278
|
+
axios?: AxiosRequestConfig;
|
|
267
279
|
}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
268
|
-
const { query: queryOptions,
|
|
280
|
+
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
269
281
|
|
|
270
|
-
const queryKey = queryOptions?.queryKey ??
|
|
282
|
+
const queryKey = queryOptions?.queryKey ?? getAppApiUnitGetQueryKey();
|
|
271
283
|
|
|
272
|
-
const queryFn: QueryFunction<AsyncReturnType<typeof
|
|
273
|
-
|
|
284
|
+
const queryFn: QueryFunction<AsyncReturnType<typeof appApiUnitGet>> = () =>
|
|
285
|
+
appApiUnitGet(axiosOptions);
|
|
274
286
|
|
|
275
|
-
const query = useQuery<AsyncReturnType<typeof
|
|
287
|
+
const query = useQuery<AsyncReturnType<typeof appApiUnitGet>, TError, TData>(
|
|
276
288
|
queryKey,
|
|
277
289
|
queryFn,
|
|
278
290
|
queryOptions
|
|
@@ -289,39 +301,42 @@ export const useGetUnits = <
|
|
|
289
301
|
|
|
290
302
|
* @summary Create a new Independent User Unit
|
|
291
303
|
*/
|
|
292
|
-
export const
|
|
293
|
-
options?:
|
|
294
|
-
) => {
|
|
295
|
-
return
|
|
296
|
-
{ url: `/unit`, method: "put" },
|
|
297
|
-
options
|
|
298
|
-
);
|
|
304
|
+
export const appApiUnitPersonalPut = (
|
|
305
|
+
options?: AxiosRequestConfig
|
|
306
|
+
): Promise<AxiosResponse<PersonalUnitPutResponse>> => {
|
|
307
|
+
return axios.put(`/unit`, undefined, options);
|
|
299
308
|
};
|
|
300
309
|
|
|
301
|
-
export
|
|
302
|
-
|
|
310
|
+
export type AppApiUnitPersonalPutMutationResult = NonNullable<
|
|
311
|
+
AsyncReturnType<typeof appApiUnitPersonalPut>
|
|
312
|
+
>;
|
|
313
|
+
|
|
314
|
+
export type AppApiUnitPersonalPutMutationError = AxiosError<AsError | void>;
|
|
315
|
+
|
|
316
|
+
export const useAppApiUnitPersonalPut = <
|
|
317
|
+
TError = AxiosError<AsError | void>,
|
|
303
318
|
TVariables = void,
|
|
304
319
|
TContext = unknown
|
|
305
320
|
>(options?: {
|
|
306
321
|
mutation?: UseMutationOptions<
|
|
307
|
-
AsyncReturnType<typeof
|
|
322
|
+
AsyncReturnType<typeof appApiUnitPersonalPut>,
|
|
308
323
|
TError,
|
|
309
324
|
TVariables,
|
|
310
325
|
TContext
|
|
311
326
|
>;
|
|
312
|
-
|
|
327
|
+
axios?: AxiosRequestConfig;
|
|
313
328
|
}) => {
|
|
314
|
-
const { mutation: mutationOptions,
|
|
329
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options || {};
|
|
315
330
|
|
|
316
331
|
const mutationFn: MutationFunction<
|
|
317
|
-
AsyncReturnType<typeof
|
|
332
|
+
AsyncReturnType<typeof appApiUnitPersonalPut>,
|
|
318
333
|
TVariables
|
|
319
334
|
> = () => {
|
|
320
|
-
return
|
|
335
|
+
return appApiUnitPersonalPut(axiosOptions);
|
|
321
336
|
};
|
|
322
337
|
|
|
323
338
|
return useMutation<
|
|
324
|
-
AsyncReturnType<typeof
|
|
339
|
+
AsyncReturnType<typeof appApiUnitPersonalPut>,
|
|
325
340
|
TError,
|
|
326
341
|
TVariables,
|
|
327
342
|
TContext
|
|
@@ -332,36 +347,42 @@ export const useCreateDefaultUnit = <
|
|
|
332
347
|
|
|
333
348
|
* @summary Deletes an Independent Unit
|
|
334
349
|
*/
|
|
335
|
-
export const
|
|
336
|
-
options?:
|
|
337
|
-
) => {
|
|
338
|
-
return
|
|
350
|
+
export const appApiUnitPersonalDelete = (
|
|
351
|
+
options?: AxiosRequestConfig
|
|
352
|
+
): Promise<AxiosResponse<void>> => {
|
|
353
|
+
return axios.delete(`/unit`, options);
|
|
339
354
|
};
|
|
340
355
|
|
|
341
|
-
export
|
|
342
|
-
|
|
356
|
+
export type AppApiUnitPersonalDeleteMutationResult = NonNullable<
|
|
357
|
+
AsyncReturnType<typeof appApiUnitPersonalDelete>
|
|
358
|
+
>;
|
|
359
|
+
|
|
360
|
+
export type AppApiUnitPersonalDeleteMutationError = AxiosError<AsError>;
|
|
361
|
+
|
|
362
|
+
export const useAppApiUnitPersonalDelete = <
|
|
363
|
+
TError = AxiosError<AsError>,
|
|
343
364
|
TVariables = void,
|
|
344
365
|
TContext = unknown
|
|
345
366
|
>(options?: {
|
|
346
367
|
mutation?: UseMutationOptions<
|
|
347
|
-
AsyncReturnType<typeof
|
|
368
|
+
AsyncReturnType<typeof appApiUnitPersonalDelete>,
|
|
348
369
|
TError,
|
|
349
370
|
TVariables,
|
|
350
371
|
TContext
|
|
351
372
|
>;
|
|
352
|
-
|
|
373
|
+
axios?: AxiosRequestConfig;
|
|
353
374
|
}) => {
|
|
354
|
-
const { mutation: mutationOptions,
|
|
375
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options || {};
|
|
355
376
|
|
|
356
377
|
const mutationFn: MutationFunction<
|
|
357
|
-
AsyncReturnType<typeof
|
|
378
|
+
AsyncReturnType<typeof appApiUnitPersonalDelete>,
|
|
358
379
|
TVariables
|
|
359
380
|
> = () => {
|
|
360
|
-
return
|
|
381
|
+
return appApiUnitPersonalDelete(axiosOptions);
|
|
361
382
|
};
|
|
362
383
|
|
|
363
384
|
return useMutation<
|
|
364
|
-
AsyncReturnType<typeof
|
|
385
|
+
AsyncReturnType<typeof appApiUnitPersonalDelete>,
|
|
365
386
|
TError,
|
|
366
387
|
TVariables,
|
|
367
388
|
TContext
|