mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
Merge branch 'improve_address' into person_renderbox_thirdparty_onthefly
This commit is contained in:
@@ -54,8 +54,8 @@ export default {
|
||||
assignAddress() {
|
||||
//console.log('assignAddress id', this.person.current_household_address);
|
||||
let payload = {
|
||||
entity: this.context.entity.name,
|
||||
entityId: this.context.entity.id,
|
||||
target: this.context.target.name,
|
||||
targetId: this.context.target.id,
|
||||
locationStatusTo: 'person',
|
||||
personId: this.person.id
|
||||
};
|
||||
|
@@ -93,7 +93,7 @@ export default {
|
||||
useDate: {
|
||||
validFrom: true
|
||||
},
|
||||
onlyButton: true
|
||||
hideAddress: true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -119,7 +119,7 @@ export default {
|
||||
methods: {
|
||||
initAddressContext() {
|
||||
let context = {
|
||||
entity: {
|
||||
target: {
|
||||
name: this.accompanyingCourse.type,
|
||||
id: this.accompanyingCourse.id
|
||||
},
|
||||
@@ -135,8 +135,8 @@ export default {
|
||||
removeAddress() {
|
||||
//console.log('remove address');
|
||||
let payload = {
|
||||
entity: this.context.entity.name,
|
||||
entityId: this.context.entity.id,
|
||||
target: this.context.target.name,
|
||||
targetId: this.context.target.id,
|
||||
locationStatusTo: 'none'
|
||||
};
|
||||
this.$store.dispatch('updateLocation', payload);
|
||||
|
@@ -261,7 +261,7 @@ let initPromise = getAccompanyingCourse(id)
|
||||
},
|
||||
updateLocation({ commit }, payload) {
|
||||
//console.log('## action: updateLocation', payload.locationStatusTo);
|
||||
let body = { 'type': payload.entity, 'id': payload.entityId };
|
||||
let body = { 'type': payload.target, 'id': payload.targetId };
|
||||
let location = {};
|
||||
if (payload.locationStatusTo === 'person') { // patch for person address (don't remove addressLocation)
|
||||
location = { 'personLocation': { 'type': 'person', 'id': payload.personId }};
|
||||
@@ -273,7 +273,7 @@ let initPromise = getAccompanyingCourse(id)
|
||||
location = { 'personLocation': null };
|
||||
}
|
||||
Object.assign(body, location);
|
||||
patchAccompanyingCourse(payload.entityId, body)
|
||||
patchAccompanyingCourse(payload.targetId, body)
|
||||
.then(accompanyingCourse => new Promise((resolve, reject) => {
|
||||
commit('updateLocation', {
|
||||
location: accompanyingCourse.location,
|
||||
|
Reference in New Issue
Block a user