mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +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)
|
postAddressTo(payload, postTo)
|
||||||
{
|
{
|
||||||
console.log('postAddressTo', postTo);
|
console.log('postAddressTo', postTo);
|
||||||
switch (postTo) {
|
if (!this.context.edit) {
|
||||||
case 'household':
|
switch (postTo) {
|
||||||
postAddressToHousehold(payload.entityId, payload.addressId)
|
case 'household':
|
||||||
.then(household => new Promise((resolve, reject) => {
|
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.loading = false;
|
||||||
this.flag.success = true;
|
this.flag.success = true;
|
||||||
if (this.options.redirectToBackUrl) {
|
if (this.options.redirectToBackUrl) {
|
||||||
window.location.assign(payload.backUrl);
|
window.location.assign(payload.backUrl);
|
||||||
}
|
}
|
||||||
resolve();
|
resolve();
|
||||||
}))
|
}))
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
this.errorMsg.push(error);
|
this.errorMsg.push(error);
|
||||||
this.flag.loading = false;
|
this.flag.loading = false;
|
||||||
})
|
})
|
||||||
;
|
;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'person':
|
case 'person':
|
||||||
default:
|
default:
|
||||||
postAddressToPerson(payload.entityId, payload.addressId)
|
postAddressToPerson(payload.entityId, payload.addressId)
|
||||||
.then(person => new Promise((resolve, reject) => {
|
.then(person => new Promise((resolve, reject) => {
|
||||||
|
|
||||||
console.log('TODO commit addAddressToPerson !!!', person);
|
console.log('TODO commit addAddressToPerson !!!', person);
|
||||||
//this.$props.result = person;
|
//this.$props.result = person;
|
||||||
|
|
||||||
this.flag.loading = false;
|
this.flag.loading = false;
|
||||||
this.flag.success = true;
|
this.flag.success = true;
|
||||||
if (this.options.redirectToBackUrl) {
|
if (this.options.redirectToBackUrl) {
|
||||||
window.location.assign(payload.backUrl);
|
window.location.assign(payload.backUrl);
|
||||||
}
|
}
|
||||||
resolve();
|
resolve();
|
||||||
}))
|
}))
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
this.errorMsg.push(error);
|
this.errorMsg.push(error);
|
||||||
this.flag.loading = false;
|
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