mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
courseLocation: commit context addressId change when remove PersonLocation (fix bad address in editPane)
This commit is contained in:
parent
4630e2b80c
commit
98f1f19e9a
@ -339,7 +339,7 @@ export default {
|
|||||||
|
|
||||||
console.log('Mounted now !');
|
console.log('Mounted now !');
|
||||||
if (this.context.edit) {
|
if (this.context.edit) {
|
||||||
console.log('getInitialAddress'); // !!!
|
console.log('getInitialAddress', this.context.addressId);
|
||||||
this.getInitialAddress(this.context.addressId);
|
this.getInitialAddress(this.context.addressId);
|
||||||
}
|
}
|
||||||
this.openShowPane();
|
this.openShowPane();
|
||||||
|
@ -133,12 +133,12 @@ export default {
|
|||||||
this.$store.commit('setAddressContext', context);
|
this.$store.commit('setAddressContext', context);
|
||||||
},
|
},
|
||||||
removeAddress() {
|
removeAddress() {
|
||||||
//console.log('remove address');
|
|
||||||
let payload = {
|
let payload = {
|
||||||
target: this.context.target.name,
|
target: this.context.target.name,
|
||||||
targetId: this.context.target.id,
|
targetId: this.context.target.id,
|
||||||
locationStatusTo: 'none'
|
locationStatusTo: 'none'
|
||||||
};
|
};
|
||||||
|
//console.log('remove address');
|
||||||
this.$store.dispatch('updateLocation', payload);
|
this.$store.dispatch('updateLocation', payload);
|
||||||
},
|
},
|
||||||
displayErrors() {
|
displayErrors() {
|
||||||
|
@ -129,9 +129,13 @@ let initPromise = getAccompanyingCourse(id)
|
|||||||
state.addressContext = context;
|
state.addressContext = context;
|
||||||
},
|
},
|
||||||
updateLocation(state, r) {
|
updateLocation(state, r) {
|
||||||
//console.log('### mutation: set location attributes', r);
|
//console.log('### mutation: set location attributes', r);
|
||||||
state.accompanyingCourse.location = r.location;
|
|
||||||
state.accompanyingCourse.locationStatus = r.locationStatus;
|
state.accompanyingCourse.locationStatus = r.locationStatus;
|
||||||
|
if (r.locationStatus !== 'person') {
|
||||||
|
state.addressContext.addressId = r.location.address_id;
|
||||||
|
//console.log('mutation: update context addressId', state.addressContext.addressId);
|
||||||
|
}
|
||||||
|
state.accompanyingCourse.location = r.location;
|
||||||
state.accompanyingCourse.personLocation = r.personLocation;
|
state.accompanyingCourse.personLocation = r.personLocation;
|
||||||
},
|
},
|
||||||
setEditContextTrue(state, payload) {
|
setEditContextTrue(state, payload) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user