@paris-ias/list 1.0.60 → 1.0.62

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@paris-ias/list",
3
3
  "configKey": "list",
4
- "version": "1.0.60",
4
+ "version": "1.0.62",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.0",
7
7
  "unbuild": "3.5.0"
@@ -50,6 +50,7 @@ export default defineNuxtPlugin(async (nuxtApp) => {
50
50
  };
51
51
  const stores = {};
52
52
  const queries = {};
53
+ const models = {};
53
54
  console.log("INITIALIZING STORES");
54
55
  await Promise.all(
55
56
  appConfig.list.modules.map(async (type) => {
@@ -60,6 +61,7 @@ export default defineNuxtPlugin(async (nuxtApp) => {
60
61
  list: (await imports.queries.list).default,
61
62
  get: (await imports.queries.get).default
62
63
  };
64
+ models[type] = model;
63
65
  stores[type] = createDynamicStore(type, model)();
64
66
  } catch (error) {
65
67
  console.error(`Failed to initialize ${type} store:`, error);
@@ -67,6 +69,7 @@ export default defineNuxtPlugin(async (nuxtApp) => {
67
69
  })
68
70
  );
69
71
  const rootStore = useRootStore();
72
+ nuxtApp.provide("models", models);
70
73
  nuxtApp.provide("rootStore", rootStore);
71
74
  nuxtApp.provide("stores", stores);
72
75
  nuxtApp.provide("queries", queries);
@@ -111,8 +111,9 @@ export const useRootStore = defineStore("rootStore", {
111
111
  router.replace({ query: routeQuery });
112
112
  },
113
113
  resetState(type) {
114
- const { $stores } = useNuxtApp();
115
- $stores[type].$reset();
114
+ const { $stores, $models } = useNuxtApp();
115
+ console.log("$models[type]: ", $models[type]);
116
+ $stores[type] = $models[type];
116
117
  console.log("resetState");
117
118
  this.search = "";
118
119
  this.page = 1;
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.60",
4
+ "version": "1.0.62",
5
5
  "name": "@paris-ias/list",
6
6
  "repository": {
7
7
  "url": "git+https://github.com/IEA-Paris/list.git",