tantee-nuxt-commons 0.0.175 → 0.0.176
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/module.json +1 -1
- package/dist/module.mjs +1 -0
- package/dist/runtime/components/form/Table.vue +2 -1
- package/dist/runtime/components/model/Table.vue +1 -1
- package/dist/runtime/composables/graphqlModel.js +5 -1
- package/dist/runtime/utils/array.d.ts +1 -0
- package/dist/runtime/utils/array.js +4 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -53,6 +53,7 @@ const module = defineNuxtModule({
|
|
|
53
53
|
_nuxt.options.vite.optimizeDeps.include.push("print-js");
|
|
54
54
|
_nuxt.options.vite.optimizeDeps.include.push("gql-query-builder");
|
|
55
55
|
_nuxt.options.vite.optimizeDeps.include.push("exif-rotate-js");
|
|
56
|
+
_nuxt.options.vite.optimizeDeps.include.push("localstorage-slim");
|
|
56
57
|
}
|
|
57
58
|
});
|
|
58
59
|
|
|
@@ -4,6 +4,7 @@ import { useAlert } from "./alert.js";
|
|
|
4
4
|
import { buildRequiredInputFields } from "./graphqlOperation.js";
|
|
5
5
|
import { useGraphqlModelOperation } from "./graphqlModelOperation.js";
|
|
6
6
|
import pLimit from "p-limit";
|
|
7
|
+
import { arrayWrap } from "../utils/array.js";
|
|
7
8
|
export function useGraphqlModel(props) {
|
|
8
9
|
const alert = useAlert();
|
|
9
10
|
const items = ref([]);
|
|
@@ -130,6 +131,8 @@ export function useGraphqlModel(props) {
|
|
|
130
131
|
items.value = result.data;
|
|
131
132
|
itemsLength.value = result.meta.totalItems;
|
|
132
133
|
}).catch((error) => {
|
|
134
|
+
items.value = [];
|
|
135
|
+
itemsLength.value = 0;
|
|
133
136
|
alert?.addAlert({ alertType: "error", message: error });
|
|
134
137
|
}).finally(() => {
|
|
135
138
|
isLoading.value = false;
|
|
@@ -142,8 +145,9 @@ export function useGraphqlModel(props) {
|
|
|
142
145
|
} else {
|
|
143
146
|
isLoading.value = true;
|
|
144
147
|
operationRead.value?.call(fields.value, props.modelBy).then((result) => {
|
|
145
|
-
items.value = result;
|
|
148
|
+
items.value = arrayWrap(result);
|
|
146
149
|
}).catch((error) => {
|
|
150
|
+
items.value = [];
|
|
147
151
|
alert?.addAlert({ alertType: "error", message: error });
|
|
148
152
|
}).finally(() => {
|
|
149
153
|
isLoading.value = false;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function arrayWrap<T>(value: T | T[] | null | undefined): T[];
|