bt-core-app 1.4.2 → 1.4.4

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 (95) hide show
  1. package/dist/index.d.ts +1273 -41
  2. package/package.json +9 -2
  3. package/dist/composables/actions-tracker.d.ts +0 -19
  4. package/dist/composables/actions.d.ts +0 -79
  5. package/dist/composables/api.d.ts +0 -86
  6. package/dist/composables/auth.d.ts +0 -70
  7. package/dist/composables/cosmetics.d.ts +0 -38
  8. package/dist/composables/csv.d.ts +0 -20
  9. package/dist/composables/dates.d.ts +0 -15
  10. package/dist/composables/demo.d.ts +0 -9
  11. package/dist/composables/dialogs.d.ts +0 -75
  12. package/dist/composables/document-meta.d.ts +0 -11
  13. package/dist/composables/draggable.d.ts +0 -56
  14. package/dist/composables/filters.d.ts +0 -11
  15. package/dist/composables/forage.d.ts +0 -7
  16. package/dist/composables/helpers.d.ts +0 -100
  17. package/dist/composables/id.d.ts +0 -1
  18. package/dist/composables/list.d.ts +0 -211
  19. package/dist/composables/navigation.d.ts +0 -89
  20. package/dist/composables/presets.d.ts +0 -8
  21. package/dist/composables/pwa.d.ts +0 -14
  22. package/dist/composables/resizable.d.ts +0 -35
  23. package/dist/composables/rules.d.ts +0 -7
  24. package/dist/composables/stores.d.ts +0 -111
  25. package/dist/composables/track.d.ts +0 -12
  26. package/dist/composables/urls.d.ts +0 -22
  27. package/dist/core.d.ts +0 -19
  28. package/dist/types.d.ts +0 -13
  29. package/dist/useApi.d.ts +0 -0
  30. package/src/assets/vue.svg +0 -1
  31. package/src/components/BT-Btn.vue +0 -41
  32. package/src/components/BT-Col.vue +0 -36
  33. package/src/components/BT-Field-Checkbox.vue +0 -70
  34. package/src/components/BT-Field-Date.vue +0 -108
  35. package/src/components/BT-Field-Entity.vue +0 -48
  36. package/src/components/BT-Field-Select.vue +0 -67
  37. package/src/components/BT-Field-String.vue +0 -78
  38. package/src/components/BT-Field-Switch.vue +0 -68
  39. package/src/components/BT-Field-Tags.vue +0 -66
  40. package/src/components/BT-Field-Textarea.vue +0 -67
  41. package/src/components/BT-Field-Trigger.vue +0 -315
  42. package/src/components/BT-Header-Option.vue +0 -39
  43. package/src/components/BT-Json.vue +0 -67
  44. package/src/components/BT-Nav-Menu-Item.vue +0 -60
  45. package/src/components/BT-Nav-Sidebar.vue +0 -78
  46. package/src/components/BT-Select-List-Box.vue +0 -258
  47. package/src/components/BT-Select.vue +0 -46
  48. package/src/components/BT-Snack.vue +0 -31
  49. package/src/components/BT-Span.vue +0 -21
  50. package/src/components/Dialog-Confirm.vue +0 -47
  51. package/src/components/Dialog-Select-Date.vue +0 -89
  52. package/src/components/Dialog-Select.vue +0 -140
  53. package/src/components/Dialog-Text.vue +0 -59
  54. package/src/composables/actions-tracker.ts +0 -99
  55. package/src/composables/actions.ts +0 -354
  56. package/src/composables/api.ts +0 -479
  57. package/src/composables/auth.ts +0 -452
  58. package/src/composables/cosmetics.ts +0 -177
  59. package/src/composables/csv.ts +0 -198
  60. package/src/composables/dates.ts +0 -86
  61. package/src/composables/demo.ts +0 -33
  62. package/src/composables/dialogs.ts +0 -114
  63. package/src/composables/document-meta.ts +0 -44
  64. package/src/composables/draggable.ts +0 -189
  65. package/src/composables/filters.ts +0 -264
  66. package/src/composables/forage.ts +0 -49
  67. package/src/composables/helpers.ts +0 -647
  68. package/src/composables/id.ts +0 -20
  69. package/src/composables/list.ts +0 -604
  70. package/src/composables/navigation.ts +0 -222
  71. package/src/composables/presets.ts +0 -28
  72. package/src/composables/pwa.ts +0 -97
  73. package/src/composables/resizable.ts +0 -382
  74. package/src/composables/rules.ts +0 -40
  75. package/src/composables/stores.ts +0 -818
  76. package/src/composables/track.ts +0 -55
  77. package/src/composables/urls.ts +0 -66
  78. package/src/core.ts +0 -113
  79. package/src/index.ts +0 -48
  80. package/src/types.ts +0 -17
  81. package/src/useApi.ts +0 -68
  82. package/src/vite-env.d.ts +0 -1
  83. package/test/api.test.ts +0 -84
  84. package/test/auth.test.ts +0 -74
  85. package/test/forage.test.ts +0 -31
  86. package/test/helpers.test.ts +0 -231
  87. package/test/navigation.test.ts +0 -99
  88. package/test/stores-last-update.test.ts +0 -138
  89. package/test/stores-session.test.ts +0 -118
  90. package/test/track.test.ts +0 -29
  91. package/test/urls.test.ts +0 -42
  92. package/test/utils.ts +0 -15
  93. package/tsconfig.json +0 -28
  94. package/tsconfig.node.json +0 -11
  95. package/vite.config.ts +0 -45
@@ -1,59 +0,0 @@
1
- <template>
2
- <v-dialog v-model="show">
3
- <div>
4
- <v-card :max-width="maxWidth ?? '400'" :min-width="minWidth" :title="title" class="mx-auto">
5
- <v-card-text>
6
- <v-text-field
7
- :label="label"
8
- v-model="mVal" />
9
- <div class="text-h6">{{ msg }}</div>
10
- </v-card-text>
11
- <v-card-actions>
12
- <v-btn @click="cancel">{{ cancelText ?? 'Cancel' }}</v-btn>
13
- <v-btn @click="confirm" :disabled="!canAccept">{{ confirmText ?? 'Done' }}</v-btn>
14
- </v-card-actions>
15
- </v-card>
16
- </div>
17
- </v-dialog>
18
- </template>
19
-
20
- <script setup lang="ts">
21
- import { computed, onMounted, ref } from 'vue';
22
- import { type TextDialogProps } from '../composables/dialogs'
23
-
24
-
25
- const props = withDefaults(defineProps<TextDialogProps>(), {
26
- height: '400'
27
- })
28
-
29
- const emit = defineEmits(['confirm', 'cancel'])
30
-
31
- const canAccept = computed(() => {
32
- return !props.required || mVal.value != null
33
- })
34
-
35
- let show = false
36
-
37
- const mVal = ref(props.value)
38
-
39
- function confirm() {
40
- if (props.required && mVal.value == null) {
41
- //required
42
- return
43
- }
44
-
45
- show = false
46
-
47
- emit('confirm', mVal.value)
48
- }
49
-
50
- function cancel() {
51
- show = false
52
- emit('cancel', undefined)
53
- }
54
-
55
- onMounted(() => {
56
- show = true
57
- })
58
-
59
- </script>
@@ -1,99 +0,0 @@
1
- import { computed, ref, shallowRef } from 'vue'
2
- import type { ShallowRef, Ref } from 'vue'
3
- // import { useConfirmAsync } from '../composables/dialogs'
4
- import { watchArray } from '@vueuse/core'
5
- import { useId } from '../composables/id'
6
-
7
- interface LoadingMsg {
8
- id: string,
9
- msg: string
10
- }
11
-
12
- export interface DoActionOptions {
13
- completionMsg?: string
14
- confirmationMsg?: string
15
- errorMsg?: string
16
- loadingMsg?: string
17
- requireConfirmation?: boolean,
18
- throwError?: boolean
19
- }
20
-
21
- export function useActionsTracker(useOptions?: DoActionOptions) {
22
- const loadingMsgs: Ref<LoadingMsg[]> = ref([])
23
- const mLoadingMsg: ShallowRef<string | undefined> = shallowRef()
24
- const mErrorMsg: ShallowRef<string | undefined> = shallowRef()
25
- const mCompletionMsg: ShallowRef<string | undefined> = shallowRef()
26
- const isLoading = computed(() => mLoadingMsg.value != null)
27
-
28
- function endLoading(id: string) {
29
- loadingMsgs.value = loadingMsgs.value.filter(x => x.id != id)
30
- }
31
-
32
- function startLoading(msg?: string): string {
33
- const e = {
34
- id: useId(),
35
- msg: msg ?? 'Loading'
36
- }
37
- loadingMsgs.value.push(e)
38
- return e.id
39
- }
40
-
41
- function logError(err?: string | Error) {
42
- if (err != null)
43
- mErrorMsg.value = err.toString()
44
- }
45
-
46
- function clearErrors() {
47
- mErrorMsg.value = undefined
48
- }
49
-
50
- async function doAction(action: any, options?: DoActionOptions) {
51
- const opt = { ...options }
52
- opt.completionMsg ??= useOptions?.completionMsg
53
- opt.confirmationMsg ??= useOptions?.confirmationMsg
54
- opt.errorMsg ??= useOptions?.errorMsg
55
- opt.loadingMsg ??= useOptions?.loadingMsg ?? 'Loading'
56
- opt.requireConfirmation ??= useOptions?.requireConfirmation
57
-
58
- const id = startLoading(opt.loadingMsg)
59
- let res: any = null
60
-
61
- try {
62
- if (opt.requireConfirmation || opt.confirmationMsg) {
63
- // if (!await useConfirmAsync(opt.confirmationMsg ?? 'Are you sure?'))
64
- // return
65
- }
66
-
67
- res = await action()
68
-
69
- if (opt.completionMsg != null) {
70
- mCompletionMsg.value = opt.completionMsg
71
- }
72
-
73
- return res
74
- }
75
- catch (err) {
76
- if (opt.throwError == true)
77
- return res
78
- else
79
- logError(opt.errorMsg ?? (err as string) ?? 'error')
80
- }
81
- finally {
82
- endLoading(id)
83
- }
84
- }
85
-
86
- watchArray(loadingMsgs, (newList: LoadingMsg[]) => {
87
- mLoadingMsg.value = newList.length > 0 ? newList[0].msg : undefined
88
- }, { deep: true })
89
-
90
- return {
91
- actionErrorMsg: mErrorMsg,
92
- actionLoadingMsg: mLoadingMsg,
93
- actionCompleteMsg: mCompletionMsg,
94
- clearErrors,
95
- doAction,
96
- isLoading,
97
- logError
98
- }
99
- }
@@ -1,354 +0,0 @@
1
- import type { BladeMode } from '../types'
2
- import { BTStoreDefinition } from '../composables/stores'
3
- import { BTApi, type PathOptions } from '../composables/api'
4
- import { useActionsTracker, type DoActionOptions } from '../composables/actions-tracker'
5
- import { ShallowRef, ComputedRef } from 'vue'
6
-
7
- export type OnCanDoAsync = (item: any) => Promise<string | undefined>
8
- export type OnDoAsync = (item: any) => Promise<string | undefined>
9
- export type OnDoSuccessAsync = (item: any) => Promise<any>
10
- export type OnGetAsync = (opt?: GetOptions) => Promise<any>
11
- export type OnGetSuccessAsync = (item: any, opt?: GetOptions) => Promise<any>
12
-
13
- export interface GetOptions extends PathOptions, DoActionOptions {
14
- /**returns an error msg if failed */
15
- onGetAsync?: OnGetAsync
16
- /**called after get occurs successfully */
17
- onGetSuccessAsync?: OnGetSuccessAsync
18
- store?: BTStoreDefinition
19
- }
20
-
21
- export interface DeleteOptions extends PathOptions, DoActionOptions {
22
- /**Returns a string if cannot */
23
- onCanDeleteAsync?: OnCanDoAsync
24
- /**Will override the default store delete action */
25
- onDeleteAsync?: OnDoAsync
26
- /**Will open a dialog box requesting user confirmation for delete action */
27
- onDeleteSuccessAsync?: OnDoAsync
28
- store?: BTStoreDefinition
29
- }
30
-
31
- export interface RestoreOptions extends PathOptions, DoActionOptions {
32
- /**Returns a string if cannot */
33
- onCanRestoreAsync?: OnCanDoAsync
34
- /**Will override the default store delete action */
35
- onRestoreAsync?: OnDoSuccessAsync
36
- /**Called after restore succeeds */
37
- onRestoreSuccessAsync?: OnDoSuccessAsync
38
- store?: BTStoreDefinition
39
- }
40
-
41
- export interface SaveOptions extends PathOptions, DoActionOptions {
42
- /**will seek to post if 'new' otherwise will patch */
43
- mode?: BladeMode
44
- /**called to check whether to proceed with save */
45
- onCanSaveAsync?: OnCanDoAsync
46
- /**
47
- * retrieves item to save
48
- * called before seeing whether it can save
49
- */
50
- onGetSaveAsync?: OnDoSuccessAsync
51
- /**Will override the default store post/patch action */
52
- onSaveAsync?: OnDoSuccessAsync
53
- /**Called after save succeeds */
54
- onSaveSuccessAsync?: OnDoSuccessAsync
55
- store?: BTStoreDefinition
56
- }
57
-
58
- export interface ApiActionOptions extends PathOptions, DoActionOptions {
59
- api: BTApi
60
- }
61
-
62
- export interface UseActionsOptions extends DoActionOptions {
63
- nav?: string
64
- proxyID?: string
65
- refresh?: boolean
66
- store?: BTStoreDefinition
67
- throwError?: boolean
68
- url?: string
69
- }
70
-
71
- export interface BTActions {
72
- apiGet: (doOptions: ApiActionOptions) => Promise<any>
73
- apiPost: (doOptions: ApiActionOptions) => Promise<any>
74
- actionLoadingMsg: ShallowRef<string | undefined>
75
- actionErrorMsg: ShallowRef<string | undefined>
76
- clearErrors: () => void
77
- deleteItem: (doOptions: DeleteOptions) => Promise<any>
78
- doAction: (action: any, options?: DoActionOptions) => Promise<any>
79
- getAllItems: (doOptions: GetOptions) => Promise<any>
80
- getItem: (doOptions: GetOptions) => Promise<any>
81
- isLoading: ComputedRef<boolean>
82
- logError: (err?: string | Error) => void
83
- restoreItem: (doOptions: RestoreOptions) => Promise<any>
84
- saveItem: (doOptions: SaveOptions) => Promise<any>
85
- }
86
-
87
- export function useActions(options?: UseActionsOptions): BTActions {
88
- const { actionErrorMsg, actionLoadingMsg, clearErrors, isLoading, doAction, logError } = useActionsTracker(options)
89
-
90
- function deleteItem(doOptions: DeleteOptions) {
91
- doOptions.nav ??= options?.nav
92
- doOptions.proxyID ??= options?.proxyID
93
- doOptions.refresh ??= options?.refresh
94
- doOptions.throwError ??= options?.throwError
95
- doOptions.url ??= options?.url
96
- doOptions.confirmationMsg ??= doOptions.requireConfirmation === true ? 'Are you sure you want to delete this item?' : undefined
97
- doOptions.store ??= options?.store
98
- const store = doOptions?.store ?? options?.store
99
-
100
- if (doOptions.nav != null && store != null) {
101
- doOptions.onDeleteAsync ??= () => {
102
- return store().deleteItem(doOptions)
103
- }
104
- }
105
-
106
- return doAction(async () => {
107
- let err: string | undefined
108
-
109
- if (doOptions.onCanDeleteAsync != null)
110
- err = await doOptions.onCanDeleteAsync(doOptions.data)
111
-
112
- if (err == undefined && doOptions.onDeleteAsync != null)
113
- err = await doOptions.onDeleteAsync(doOptions.data)
114
-
115
- if (err == undefined && doOptions.onDeleteSuccessAsync != null) {
116
- await doOptions.onDeleteSuccessAsync(doOptions.data)
117
- }
118
-
119
- logError(err)
120
- }, {
121
- completionMsg: doOptions.completionMsg ?? options?.completionMsg,
122
- confirmationMsg: doOptions.confirmationMsg ?? options?.confirmationMsg,
123
- errorMsg: doOptions.errorMsg ?? options?.errorMsg,
124
- loadingMsg: doOptions.loadingMsg ?? options?.loadingMsg ?? 'Deleting',
125
- requireConfirmation: doOptions.requireConfirmation ?? options?.requireConfirmation,
126
- throwError: doOptions.throwError ?? options?.throwError
127
- })
128
- }
129
-
130
- function getItem(doOptions: GetOptions) {
131
- doOptions.nav ??= options?.nav
132
- doOptions.proxyID ??= options?.proxyID
133
- doOptions.refresh ??= options?.refresh
134
- doOptions.throwError ??= options?.throwError
135
- doOptions.url ??= options?.url
136
- doOptions.confirmationMsg ??= doOptions.requireConfirmation === true ? 'Are you sure you want to get this item?' : undefined
137
- const store = doOptions?.store ?? options?.store
138
-
139
- if (doOptions.nav != null && store != null) {
140
- doOptions.onGetAsync ??= () => {
141
- return store().get(doOptions)
142
- }
143
- }
144
-
145
- return doAction(async () => {
146
- let res: any
147
-
148
- if (doOptions.onGetAsync != null) {
149
- res = await doOptions.onGetAsync(doOptions)
150
- res = res.data
151
- }
152
-
153
- if (doOptions.onGetSuccessAsync != null)
154
- res = await doOptions.onGetSuccessAsync(res, doOptions)
155
-
156
- return res
157
- }, {
158
- completionMsg: doOptions.completionMsg ?? options?.completionMsg,
159
- confirmationMsg: doOptions.confirmationMsg ?? options?.confirmationMsg,
160
- errorMsg: doOptions.errorMsg ?? options?.errorMsg,
161
- loadingMsg: doOptions.loadingMsg ?? options?.loadingMsg ?? 'Retrieving',
162
- requireConfirmation: doOptions.requireConfirmation ?? options?.requireConfirmation,
163
- throwError: doOptions.throwError ?? options?.throwError
164
- })
165
- }
166
-
167
- function getAllItems(doOptions: GetOptions) {
168
- doOptions.nav ??= options?.nav
169
- doOptions.proxyID ??= options?.proxyID
170
- doOptions.refresh ??= options?.refresh
171
- doOptions.throwError ??= options?.throwError
172
- doOptions.url ??= options?.url
173
- doOptions.confirmationMsg ??= doOptions.requireConfirmation === true ? 'Are you sure you want to get these items?' : undefined
174
- const store = doOptions?.store ?? options?.store
175
-
176
- if (doOptions.nav != null && store != null) {
177
- doOptions.onGetAsync ??= () => {
178
- return store().getAll(doOptions)
179
- }
180
- }
181
-
182
- return doAction(async () => {
183
- let res: any
184
-
185
- if (doOptions.onGetAsync != null) {
186
- res = await doOptions.onGetAsync(doOptions)
187
- }
188
-
189
- if (doOptions.onGetSuccessAsync != null)
190
- res = await doOptions.onGetSuccessAsync(res, doOptions)
191
-
192
- return res
193
- }, {
194
- completionMsg: doOptions.completionMsg ?? options?.completionMsg,
195
- confirmationMsg: doOptions.confirmationMsg ?? options?.confirmationMsg,
196
- errorMsg: doOptions.errorMsg ?? options?.errorMsg,
197
- loadingMsg: doOptions.loadingMsg ?? options?.loadingMsg ?? 'Retrieving',
198
- requireConfirmation: doOptions.requireConfirmation ?? options?.requireConfirmation,
199
- throwError: doOptions.throwError ?? options?.throwError
200
- })
201
- }
202
-
203
- function restoreItem(doOptions: RestoreOptions) {
204
- doOptions.nav ??= options?.nav
205
- doOptions.proxyID ??= options?.proxyID
206
- doOptions.refresh ??= options?.refresh
207
- doOptions.throwError ??= options?.throwError
208
- doOptions.url ??= options?.url
209
- doOptions.confirmationMsg ??= doOptions.requireConfirmation === true ? 'Are you sure you want to restore this item?' : undefined
210
- const store = doOptions?.store ?? options?.store
211
-
212
- if (doOptions.nav != null && store != null) {
213
- doOptions.onRestoreAsync ??= () => {
214
- return store().restore(doOptions)
215
- }
216
- }
217
-
218
- return doAction(async () => {
219
- let err: string | undefined
220
- let res: any
221
-
222
- if (doOptions.onCanRestoreAsync != null)
223
- err = await doOptions.onCanRestoreAsync(doOptions.data)
224
-
225
- if (err == undefined && doOptions.onRestoreAsync != null)
226
- res = await doOptions.onRestoreAsync(doOptions.data)
227
-
228
- if (res != null && doOptions.onRestoreSuccessAsync != null)
229
- await doOptions.onRestoreSuccessAsync(res)
230
-
231
- logError(err)
232
-
233
- return res
234
- }, {
235
- completionMsg: doOptions.completionMsg ?? options?.completionMsg,
236
- confirmationMsg: doOptions.confirmationMsg ?? options?.confirmationMsg,
237
- errorMsg: doOptions.errorMsg ?? options?.errorMsg,
238
- loadingMsg: doOptions.loadingMsg ?? options?.loadingMsg ?? 'Restoring',
239
- requireConfirmation: doOptions.requireConfirmation ?? options?.requireConfirmation,
240
- throwError: doOptions.throwError ?? options?.throwError
241
- })
242
- }
243
-
244
- function saveItem(doOptions: SaveOptions) {
245
- doOptions.nav ??= options?.nav
246
- doOptions.proxyID ??= options?.proxyID
247
- doOptions.refresh ??= options?.refresh
248
- doOptions.throwError ??= options?.throwError
249
- doOptions.url ??= options?.url
250
- doOptions.confirmationMsg ??= doOptions.requireConfirmation === true ? 'Are you sure you want to save this item?' : undefined
251
- const store = doOptions?.store ?? options?.store
252
-
253
- doOptions.onGetSaveAsync ??= (item: any) => item
254
- doOptions.onCanSaveAsync ??= () => Promise.resolve(undefined)
255
-
256
- if (doOptions.nav != null && store != null) {
257
- doOptions.onSaveAsync ??= async () => { //item: any
258
- if (doOptions.mode == 'new') {
259
- return await store().post(doOptions)
260
- }
261
- else {
262
- return await store().patch(doOptions)
263
- }
264
- }
265
- }
266
-
267
- return doAction(async () => {
268
- let itemToSave: any
269
-
270
- if (doOptions.onGetSaveAsync != null)
271
- itemToSave = await doOptions.onGetSaveAsync(doOptions.data)
272
-
273
- if (itemToSave == null)
274
- return undefined
275
-
276
- if (doOptions.onCanSaveAsync != null) {
277
- let err = await doOptions.onCanSaveAsync(itemToSave)
278
- logError(err)
279
-
280
- if (err == null)
281
- return undefined
282
- }
283
-
284
- let res: any
285
- if (doOptions.onSaveAsync != null) {
286
- res = await doOptions.onSaveAsync!(itemToSave)
287
- res = res.data
288
- }
289
-
290
- if (doOptions.onSaveSuccessAsync != null) {
291
- res = await doOptions.onSaveSuccessAsync(res)
292
- }
293
-
294
- return res
295
- }, {
296
- completionMsg: doOptions.completionMsg ?? options?.completionMsg,
297
- confirmationMsg: doOptions.confirmationMsg ?? options?.confirmationMsg,
298
- errorMsg: doOptions.errorMsg ?? options?.errorMsg,
299
- loadingMsg: doOptions.loadingMsg ?? options?.loadingMsg ?? 'Saving',
300
- requireConfirmation: doOptions.requireConfirmation ?? options?.requireConfirmation,
301
- throwError: doOptions.throwError ?? options?.throwError
302
- })
303
- }
304
-
305
- /**
306
- * Post to api (no extra '/post' url or anything)
307
- * @param options
308
- */
309
- function apiPost(doOptions: ApiActionOptions) {
310
- doOptions.nav ??= options?.nav
311
- doOptions.proxyID ??= options?.proxyID
312
- doOptions.refresh ??= options?.refresh
313
- doOptions.throwError ??= options?.throwError
314
- doOptions.url ??= options?.url
315
-
316
- return doAction(async () => {
317
- return await doOptions.api.post(doOptions)
318
- }, options)
319
- }
320
-
321
- /**
322
- * Get from api (no extra '/get' url or anything)
323
- */
324
- function apiGet(doOptions: ApiActionOptions) {
325
- doOptions.nav ??= options?.nav
326
- doOptions.proxyID ??= options?.proxyID
327
- doOptions.refresh ??= options?.refresh
328
- doOptions.throwError ??= options?.throwError
329
- doOptions.url ??= options?.url
330
-
331
- return doAction(async () => {
332
- return await doOptions.api.get(doOptions)
333
- }, options)
334
- }
335
-
336
- return {
337
- apiGet,
338
- apiPost,
339
- actionLoadingMsg,
340
- actionErrorMsg,
341
- clearErrors,
342
- deleteItem,
343
- doAction,
344
- getAllItems,
345
- getItem,
346
- isLoading,
347
- logError,
348
- restoreItem,
349
- saveItem
350
- }
351
- }
352
-
353
-
354
- //#endregion