otf: post/patch thirdparty ok, with addAddress creation/edition

This commit is contained in:
2021-09-30 21:09:11 +02:00
parent a316cb9568
commit 4c9d352c46
4 changed files with 39 additions and 22 deletions

View File

@@ -160,10 +160,9 @@ export default {
break;
default:
if (typeof this.type === 'undefined') {
if (typeof this.type === 'undefined') { // action=create
type = this.$refs.castNew.radioType;
data = this.$refs.castNew.castDataByType();
} else {
throw 'error with object type';
}

View File

@@ -72,7 +72,10 @@ export default {
case 'person':
return this.$refs.castPerson.$data.person;
case 'thirdparty':
return this.$refs.castThirdparty.$data.thirdparty;
let data = this.$refs.castThirdparty.$data.thirdparty;
data.name = data.text;
data.address = { id: data.address.address_id }
return data;
default:
throw Error('Invalid type of entity')
}