mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
rename key in payload
This commit is contained in:
parent
e8e2607076
commit
29b5e700f6
@ -25,7 +25,7 @@ export default {
|
|||||||
let payload = {
|
let payload = {
|
||||||
entity: this.context.entity.type,
|
entity: this.context.entity.type,
|
||||||
entityId: this.context.entity.id,
|
entityId: this.context.entity.id,
|
||||||
addressToPatch: 'person',
|
locationStatusTo: 'person',
|
||||||
personId: this.person.id
|
personId: this.person.id
|
||||||
};
|
};
|
||||||
this.$store.dispatch('updateLocation', payload);
|
this.$store.dispatch('updateLocation', payload);
|
||||||
|
@ -121,7 +121,7 @@ export default {
|
|||||||
let payload = {
|
let payload = {
|
||||||
entity: this.context.entity.type,
|
entity: this.context.entity.type,
|
||||||
entityId: this.context.entity.id,
|
entityId: this.context.entity.id,
|
||||||
addressToPatch: 'none'
|
locationStatusTo: 'none'
|
||||||
};
|
};
|
||||||
this.$store.dispatch('updateLocation', payload);
|
this.$store.dispatch('updateLocation', payload);
|
||||||
},
|
},
|
||||||
@ -130,12 +130,8 @@ export default {
|
|||||||
},
|
},
|
||||||
submitTemporaryAddress() {
|
submitTemporaryAddress() {
|
||||||
console.log('@@@ click on Submit Temporary Address Button');
|
console.log('@@@ click on Submit Temporary Address Button');
|
||||||
|
|
||||||
let payload = this.$refs.addAddress.submitNewAddress();
|
let payload = this.$refs.addAddress.submitNewAddress();
|
||||||
|
payload['locationStatusTo'] = 'address'; // <== temporary, not none, not person
|
||||||
// precise in payload that it is a temporary address
|
|
||||||
payload['addressToPatch'] = 'address';
|
|
||||||
|
|
||||||
this.$store.dispatch('updateLocation', payload);
|
this.$store.dispatch('updateLocation', payload);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -226,15 +226,13 @@ let initPromise = getAccompanyingCourse(id)
|
|||||||
console.log('## action: updateLocation', payload);
|
console.log('## action: updateLocation', payload);
|
||||||
let body = { 'type': payload.entity, 'id': payload.entityId };
|
let body = { 'type': payload.entity, 'id': payload.entityId };
|
||||||
let location = {};
|
let location = {};
|
||||||
if (payload.addressToPatch === 'person') {
|
if (payload.locationStatusTo === 'person') { // patch for person address (don't remove addressLocation)
|
||||||
// payload to patch person address (don't remove addressLocation)
|
|
||||||
location = { 'personLocation': { 'type': 'person', 'id': payload.personId }};
|
location = { 'personLocation': { 'type': 'person', 'id': payload.personId }};
|
||||||
}
|
}
|
||||||
else if(payload.addressToPatch === 'address') {
|
else if (payload.locationStatusTo === 'address') { // patch for temporary address
|
||||||
// payload to patch temporary address
|
|
||||||
location = { 'personLocation': null, 'addressLocation': { 'id': payload.addressId }};
|
location = { 'personLocation': null, 'addressLocation': { 'id': payload.addressId }};
|
||||||
}
|
}
|
||||||
else {
|
else { // patch to remove person address
|
||||||
location = { 'personLocation': null };
|
location = { 'personLocation': null };
|
||||||
}
|
}
|
||||||
Object.assign(body, location);
|
Object.assign(body, location);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user