From d66ed8d52d4839385ddef5faa404eefa6255570f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 7 Apr 2025 15:51:38 +0200 Subject: [PATCH] Bug 37930: Migrate to setup-style store using reactive state and toRefs Signed-off-by: Jonathan Druart --- .../intranet-tmpl/prog/js/vue/stores/erm.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/erm.js b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/erm.js index 3a32409c99f..6552b118d31 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/erm.js +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/erm.js @@ -1,9 +1,9 @@ import { defineStore } from "pinia"; - +import { reactive, toRefs } from "vue"; import { withAuthorisedValueActions } from "../composables/authorisedValues"; -export const useERMStore = defineStore("erm", { - state: () => ({ +export const useERMStore = defineStore("erm", () => { + const store = reactive({ config: { settings: { ERMModule: false, @@ -60,8 +60,11 @@ export const useERMStore = defineStore("erm", { { value: "related_to", description: __("related to") }, ], }, - }), - actions: { - ...withAuthorisedValueActions(this), - }, + }); + const sharedActions = withAuthorisedValueActions(store); + + return { + ...toRefs(store), + ...sharedActions, + }; }); -- 2.34.1