mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
rename key in payload
This commit is contained in:
parent
e8e2607076
commit
29b5e700f6
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user