diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/ButtonLocation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/ButtonLocation.vue index 5f52522c1..58956325f 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/ButtonLocation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/ButtonLocation.vue @@ -25,7 +25,7 @@ export default { let payload = { entity: this.context.entity.type, entityId: this.context.entity.id, - addressToPatch: 'person', + locationStatusTo: 'person', personId: this.person.id }; this.$store.dispatch('updateLocation', payload); diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue index 74f83a6b6..0aae70295 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue @@ -121,7 +121,7 @@ export default { let payload = { entity: this.context.entity.type, entityId: this.context.entity.id, - addressToPatch: 'none' + locationStatusTo: 'none' }; this.$store.dispatch('updateLocation', payload); }, @@ -130,12 +130,8 @@ export default { }, submitTemporaryAddress() { console.log('@@@ click on Submit Temporary Address Button'); - let payload = this.$refs.addAddress.submitNewAddress(); - - // precise in payload that it is a temporary address - payload['addressToPatch'] = 'address'; - + payload['locationStatusTo'] = 'address'; // <== temporary, not none, not person this.$store.dispatch('updateLocation', payload); } }, diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js index f7843d2aa..131bc7ce6 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js @@ -226,15 +226,13 @@ let initPromise = getAccompanyingCourse(id) console.log('## action: updateLocation', payload); let body = { 'type': payload.entity, 'id': payload.entityId }; let location = {}; - if (payload.addressToPatch === 'person') { - // payload to patch person address (don't remove addressLocation) + if (payload.locationStatusTo === 'person') { // patch for person address (don't remove addressLocation) location = { 'personLocation': { 'type': 'person', 'id': payload.personId }}; } - else if(payload.addressToPatch === 'address') { - // payload to patch temporary address + else if (payload.locationStatusTo === 'address') { // patch for temporary address location = { 'personLocation': null, 'addressLocation': { 'id': payload.addressId }}; } - else { + else { // patch to remove person address location = { 'personLocation': null }; } Object.assign(body, location);