From 65a67556199e7988e698c8501abe9ef78e85b667 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 --- .../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 af0587d3750..ded1dae20c3 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.30.2