mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
Merge branch 'improve_address' into person_renderbox_thirdparty_onthefly
This commit is contained in:
@@ -31,8 +31,8 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
//console.log('AddAddress: data context', this.context);
|
||||
//console.log('AddAddress: data options', this.options);
|
||||
console.log('AddAddress: data context', this.context);
|
||||
console.log('AddAddress: data options', this.options);
|
||||
},
|
||||
methods: {
|
||||
displayErrors() {
|
||||
@@ -45,7 +45,7 @@ export default {
|
||||
if (this.context.edit) {
|
||||
|
||||
// address is already linked, just finish !
|
||||
this.$refs.addAddress.lastPaneAction();
|
||||
this.$refs.addAddress.afterLastPaneAction({});
|
||||
|
||||
// New created address
|
||||
} else {
|
||||
@@ -83,17 +83,17 @@ export default {
|
||||
* Post new created address to targetEntity
|
||||
*/
|
||||
postAddressTo(payload) {
|
||||
console.log('postAddressTo', payload.target);
|
||||
console.log('postAddress', payload.addressId, 'To', payload.target, payload.targetId);
|
||||
switch (payload.target) {
|
||||
case 'household':
|
||||
postAddressToHousehold(payload.targetId, payload.addressId)
|
||||
.then(household => new Promise((resolve, reject) => {
|
||||
console.log('..toHousehold', household);
|
||||
.then(address => new Promise((resolve, reject) => {
|
||||
console.log('..household address', address);
|
||||
this.$refs.addAddress.flag.loading = false;
|
||||
this.$refs.addAddress.flag.success = true;
|
||||
|
||||
// finish
|
||||
this.$refs.addAddress.lastPaneAction();
|
||||
this.$refs.addAddress.afterLastPaneAction({ addressId: address.address_id });
|
||||
|
||||
resolve();
|
||||
}))
|
||||
@@ -105,13 +105,13 @@ export default {
|
||||
break;
|
||||
case 'person':
|
||||
postAddressToPerson(payload.targetId, payload.addressId)
|
||||
.then(person => new Promise((resolve, reject) => {
|
||||
console.log('..toPerson', person);
|
||||
.then(address => new Promise((resolve, reject) => {
|
||||
console.log('..person address', address);
|
||||
this.$refs.addAddress.flag.loading = false;
|
||||
this.$refs.addAddress.flag.success = true;
|
||||
|
||||
// finish
|
||||
this.$refs.addAddress.lastPaneAction();
|
||||
this.$refs.addAddress.afterLastPaneAction({ addressId: address.address_id });
|
||||
|
||||
resolve();
|
||||
}))
|
||||
|
Reference in New Issue
Block a user