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