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 <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1610a1d163)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
This commit is contained in:
Pedro Amorim 2023-04-12 08:36:18 +00:00 committed by Matt Blenkinsop
parent 9d2efd3ad6
commit ac5e350ead
1 changed files with 3 additions and 4 deletions

View File

@ -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.$__(