From 1610a1d1633e7c398096e86a98239fd9171b5ea7 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Wed, 12 Apr 2023 08:36:18 +0000 Subject: [PATCH] Bug 33408: Add storeToRefs to ERMStore It makes it so that any changes to the local property is also reflected in the store and other components are made aware of the new value. No need to explicitly change both local property and store property values. Signed-off-by: Pedro Amorim Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi --- .../intranet-tmpl/prog/js/vue/components/ERM/Main.vue | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue index af0587d375..ded1dae20c 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue @@ -138,7 +138,7 @@ export default { const ERMStore = inject("ERMStore") - const { sysprefs, providers } = ERMStore + const { sysprefs, providers } = storeToRefs(ERMStore) return { vendorStore, @@ -214,8 +214,7 @@ export default { promises.push( sysprefs_client.sysprefs.get("ERMProviders").then( providers => { - this.ERMStore.providers = providers.value.split(",") - this.providers = this.ERMStore.providers + this.providers = providers.value.split(",") }, error => {} ) @@ -227,7 +226,7 @@ export default { sysprefs_client.sysprefs .get("ERMModule") .then(value => { - this.ERMStore.sysprefs.ERMModule = value.value + this.sysprefs.ERMModule = value.value if (this.sysprefs.ERMModule != 1) { return this.setError( this.$__( -- 2.39.2