mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix 500: in edit context, we don't need to postAddressTo a second time !
This commit is contained in:
parent
44313b507a
commit
72cd9f452e
@ -539,47 +539,54 @@ export default {
|
||||
postAddressTo(payload, postTo)
|
||||
{
|
||||
console.log('postAddressTo', postTo);
|
||||
switch (postTo) {
|
||||
case 'household':
|
||||
postAddressToHousehold(payload.entityId, payload.addressId)
|
||||
.then(household => new Promise((resolve, reject) => {
|
||||
if (!this.context.edit) {
|
||||
switch (postTo) {
|
||||
case 'household':
|
||||
postAddressToHousehold(payload.entityId, payload.addressId)
|
||||
.then(household => new Promise((resolve, reject) => {
|
||||
|
||||
console.log('TODO commit addAddressToHousehold', household);
|
||||
console.log('TODO commit addAddressToHousehold', household);
|
||||
|
||||
this.flag.loading = false;
|
||||
this.flag.success = true;
|
||||
if (this.options.redirectToBackUrl) {
|
||||
window.location.assign(payload.backUrl);
|
||||
}
|
||||
resolve();
|
||||
}))
|
||||
.catch((error) => {
|
||||
this.errorMsg.push(error);
|
||||
this.flag.loading = false;
|
||||
})
|
||||
;
|
||||
break;
|
||||
this.flag.loading = false;
|
||||
this.flag.success = true;
|
||||
if (this.options.redirectToBackUrl) {
|
||||
window.location.assign(payload.backUrl);
|
||||
}
|
||||
resolve();
|
||||
}))
|
||||
.catch((error) => {
|
||||
this.errorMsg.push(error);
|
||||
this.flag.loading = false;
|
||||
})
|
||||
;
|
||||
break;
|
||||
|
||||
case 'person':
|
||||
default:
|
||||
postAddressToPerson(payload.entityId, payload.addressId)
|
||||
.then(person => new Promise((resolve, reject) => {
|
||||
case 'person':
|
||||
default:
|
||||
postAddressToPerson(payload.entityId, payload.addressId)
|
||||
.then(person => new Promise((resolve, reject) => {
|
||||
|
||||
console.log('TODO commit addAddressToPerson !!!', person);
|
||||
//this.$props.result = person;
|
||||
console.log('TODO commit addAddressToPerson !!!', person);
|
||||
//this.$props.result = person;
|
||||
|
||||
this.flag.loading = false;
|
||||
this.flag.success = true;
|
||||
if (this.options.redirectToBackUrl) {
|
||||
window.location.assign(payload.backUrl);
|
||||
}
|
||||
resolve();
|
||||
}))
|
||||
.catch((error) => {
|
||||
this.errorMsg.push(error);
|
||||
this.flag.loading = false;
|
||||
})
|
||||
;
|
||||
this.flag.loading = false;
|
||||
this.flag.success = true;
|
||||
if (this.options.redirectToBackUrl) {
|
||||
window.location.assign(payload.backUrl);
|
||||
}
|
||||
resolve();
|
||||
}))
|
||||
.catch((error) => {
|
||||
this.errorMsg.push(error);
|
||||
this.flag.loading = false;
|
||||
})
|
||||
;
|
||||
}
|
||||
} else {
|
||||
// address is already posted, just finish !
|
||||
if (this.options.redirectToBackUrl) {
|
||||
window.location.assign(payload.backUrl);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user