* Hot-fix of bug with rendering a variable from vuex store before it's load(when variable is null)

feature: no-task
This commit is contained in:
2023-01-06 23:23:28 +01:00
parent a6a0a4ed34
commit aff1564b64
3 changed files with 20 additions and 11 deletions

View File

@@ -18,10 +18,15 @@ export default {
const contracts = await getContracts()
commit('initContracts', contracts)
},
async fetchContractById({ commit }, id) {
const currentContract = await getContractById(id)
commit('setCurrentContract', currentContract)
async fetchContractById({ commit, state }, id) {
const contract = await getContractById(id)
commit('setCurrentContract', contract)
return state.currentContract
}
},
getters: {}
getters: {
currentContract: state => {
return state.currentContract
}
}
}