From 6c3506eb6d2f18c73ce116b58f0fa72e02c6347b Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Mon, 7 Apr 2025 15:51:38 +0200
Subject: [PATCH] Bug 37930: Migrate to setup-style store using reactive state
 and toRefs

---
 .../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