Address: courseLocation, update addressId when commit context in store

This commit is contained in:
Mathieu Jaumotte 2021-09-22 19:25:37 +02:00
parent d52ab2188c
commit 0ed2dc8b13
2 changed files with 5 additions and 4 deletions

View File

@ -149,7 +149,7 @@ export default {
console.log('@@@ click on Submit Temporary Address Button', payload);
payload['locationStatusTo'] = 'address'; // <== temporary, not none, not person
this.$store.dispatch('updateLocation', payload);
this.$store.commit('setEditContextTrue');
this.$store.commit('setEditContextTrue', payload);
}
},
mounted() {

View File

@ -134,9 +134,10 @@ let initPromise = getAccompanyingCourse(id)
state.accompanyingCourse.locationStatus = r.locationStatus;
state.accompanyingCourse.personLocation = r.personLocation;
},
setEditContextTrue(state) {
//console.log('### mutation: set edit context = true');
setEditContextTrue(state, payload) {
console.log('### mutation: set edit context true with addressId', payload.addressId);
state.addressContext.edit = true;
state.addressContext.addressId = payload.addressId;
}
},
actions: {
@ -260,7 +261,7 @@ let initPromise = getAccompanyingCourse(id)
})).catch((error) => { commit('catchError', error) });
},
updateLocation({ commit }, payload) {
//console.log('## action: updateLocation', payload.locationStatusTo);
console.log('## action: updateLocation', payload.locationStatusTo);
let body = { 'type': payload.target, 'id': payload.targetId };
let location = {};
if (payload.locationStatusTo === 'person') { // patch for person address (don't remove addressLocation)