mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
replace store by data() for OnTheFly creation in AddPersons component
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user