replace store by data() for OnTheFly creation in AddPersons component

This commit is contained in:
2021-08-26 00:06:24 +02:00
parent ccb302ad28
commit 34df295801
3 changed files with 27 additions and 27 deletions

View File

@@ -22,7 +22,6 @@ let initPromise = getAccompanyingCourse(id)
state: {
accompanyingCourse: accompanying_course,
addressContext: {},
priorSuggestion: {},
errorMsg: []
},
getters: {
@@ -48,25 +47,9 @@ let initPromise = getAccompanyingCourse(id)
return true;
}
return false;
},
hasPriorSuggestion(state, getters) {
return state.priorSuggestion.key ? true : false;
}
},
mutations: {
newPriorSuggestion(state, entity) {
console.log('### mutation newPriorSuggestion', entity);
if (entity !== null) {
let suggestion = {
key: entity.type + entity.id,
relevance: 0.5,
result: entity
}
state.priorSuggestion = suggestion;
} else {
state.priorSuggestion = {};
}
},
catchError(state, error) {
console.log('### mutation: a new error have been catched and pushed in store !', error);
state.errorMsg.push(error);