@paris-ias/list 1.0.66 → 1.0.68
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
CHANGED
|
@@ -5,8 +5,6 @@ export declare const useRootStore: import("pinia").StoreDefinition<"rootStore",
|
|
|
5
5
|
loadRouteQuery(type: string): void;
|
|
6
6
|
loadFiltersFromLocalStorage(type: string): void;
|
|
7
7
|
setFiltersCount(type: string): void;
|
|
8
|
-
setBlankFilterLoad(type: string): void;
|
|
9
|
-
setDefaults(): void;
|
|
10
8
|
updateRouteQuery(type: string): void;
|
|
11
9
|
resetState(type: string): void;
|
|
12
10
|
updateSort({ value, type }: {
|
|
@@ -83,11 +83,6 @@ export const useRootStore = defineStore("rootStore", {
|
|
|
83
83
|
}, 0);
|
|
84
84
|
$stores[type].filtersCount = count;
|
|
85
85
|
},
|
|
86
|
-
setBlankFilterLoad(type) {
|
|
87
|
-
},
|
|
88
|
-
setDefaults() {
|
|
89
|
-
const lang = localStorage.getItem("lang");
|
|
90
|
-
},
|
|
91
86
|
updateRouteQuery(type) {
|
|
92
87
|
const router = useRouter();
|
|
93
88
|
const { $stores } = useNuxtApp();
|
|
@@ -114,15 +109,7 @@ export const useRootStore = defineStore("rootStore", {
|
|
|
114
109
|
const { $stores, $models } = useNuxtApp();
|
|
115
110
|
console.log("$models[type]: ", $models[type]);
|
|
116
111
|
const store = $stores[type];
|
|
117
|
-
|
|
118
|
-
for (const key in store.filters) {
|
|
119
|
-
if (store.filters[key].multiple) {
|
|
120
|
-
store.filters[key].value = [];
|
|
121
|
-
} else {
|
|
122
|
-
store.filters[key].value = "";
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
112
|
+
$stores[type] = $models[type];
|
|
126
113
|
console.log("resetState");
|
|
127
114
|
this.search = "";
|
|
128
115
|
this.page = 1;
|
|
@@ -186,7 +173,7 @@ export const useRootStore = defineStore("rootStore", {
|
|
|
186
173
|
await this.update(type, lang);
|
|
187
174
|
},
|
|
188
175
|
async update(type, lang = "en") {
|
|
189
|
-
const { $stores } = useNuxtApp();
|
|
176
|
+
const { $stores, $queries } = useNuxtApp();
|
|
190
177
|
this.setLoading(true);
|
|
191
178
|
if (type !== "all") {
|
|
192
179
|
$stores[type].loading = true;
|
|
@@ -225,11 +212,11 @@ export const useRootStore = defineStore("rootStore", {
|
|
|
225
212
|
let result = {};
|
|
226
213
|
console.log("args: ", args);
|
|
227
214
|
console.log(`Fetching ${type}`);
|
|
228
|
-
const { $queries } = useNuxtApp();
|
|
229
215
|
const { data, error } = await useAsyncQuery(
|
|
230
216
|
type === "all" ? SEARCH : $queries[type].list,
|
|
231
217
|
args
|
|
232
218
|
);
|
|
219
|
+
console.log("data: ", data);
|
|
233
220
|
if (error.value) console.log(error.value);
|
|
234
221
|
const key = type === "all" ? "search" : "list" + type.charAt(0).toUpperCase() + type.slice(1);
|
|
235
222
|
if (type === "all") {
|
|
@@ -247,7 +234,6 @@ export const useRootStore = defineStore("rootStore", {
|
|
|
247
234
|
$stores[type].items = result["items"];
|
|
248
235
|
const lastPage = Math.ceil(result.total / itemsPerPage);
|
|
249
236
|
this.setFiltersCount(type);
|
|
250
|
-
this.setBlankFilterLoad(type);
|
|
251
237
|
$stores[type].numberOfPages = lastPage;
|
|
252
238
|
}
|
|
253
239
|
this.setLoading(false, type);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"license": "AGPL-3.0-only",
|
|
3
3
|
"main": "./dist/module.mjs",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.68",
|
|
5
5
|
"name": "@paris-ias/list",
|
|
6
6
|
"repository": {
|
|
7
7
|
"url": "git+https://github.com/IEA-Paris/list.git",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@nuxtjs/apollo": "^5.0.0-alpha.14",
|
|
24
24
|
"@nuxtjs/i18n": "^9.5.2",
|
|
25
25
|
"@nuxtjs/mdc": "0.16.1",
|
|
26
|
-
"@paris-ias/data": "^1.8.
|
|
26
|
+
"@paris-ias/data": "^1.8.3",
|
|
27
27
|
"@pinia/nuxt": "^0.10.1",
|
|
28
28
|
"@types/node": "latest",
|
|
29
29
|
"@urql/exchange-execute": "2.3.1",
|