further attempts to do POST of thirdparty contact, passing parent id causes problems + civility and profession fk's are not saved on POST

This commit is contained in:
2022-01-17 12:00:22 +01:00
parent 1a07c9d71a
commit 604c7f385e
3 changed files with 18 additions and 8 deletions

View File

@@ -154,8 +154,7 @@ export default {
return {
//context: {}, <--
thirdparty: {
type: 'thirdparty',
parent: this.parent.id
type: 'thirdparty'
},
professions: [],
civilities: [],
@@ -213,7 +212,7 @@ export default {
getThirdparty(this.id).then(thirdparty => new Promise((resolve, reject) => {
this.thirdparty = thirdparty;
this.thirdparty.kind = thirdparty.kind;
//console.log('get thirdparty', thirdparty);
console.log('get thirdparty', thirdparty);
if (this.action !== 'show') {
if (thirdparty.address !== null) {
// bof! we force getInitialAddress because addressId not available when mounted
@@ -262,6 +261,9 @@ export default {
this.loadData();
}
if (this.action === 'addContact') {
this.$data.thirdparty.kind = 'child'
// this.$data.thirdparty.parent = this.parent.id
this.$data.thirdparty.address = null
this.loadProfessions();
this.loadCivilities();
}