mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
possible to add a contact to a thirdparty
This commit is contained in:
@@ -212,10 +212,22 @@ export default {
|
||||
type = 'thirdparty'
|
||||
data = this.$refs.castThirdparty.$data.thirdparty;
|
||||
// create the new contact here, bypassing saveFormOnTheFly() -> not working here?
|
||||
console.log('addContact data', data)
|
||||
postThirdparty(data)
|
||||
const body = {
|
||||
"type": "thirdparty",
|
||||
"kind": "child",
|
||||
"name": data.text,
|
||||
"isChild": true,
|
||||
"parent": {"type": "thirdparty", "id": this.parent.id},
|
||||
"civility": {"id": data.civility},
|
||||
"profession": {"id": data.profession},
|
||||
"comment": data.comment,
|
||||
"phonenumber": data.phonenumber,
|
||||
}
|
||||
// console.log('body', body)
|
||||
postThirdparty(body)
|
||||
.then(thirdparty => new Promise((resolve, reject) => {
|
||||
this.newPriorSuggestion(thirdparty);
|
||||
// this.newPriorSuggestion(thirdparty);
|
||||
console.log('thirdparty created', thirdparty)
|
||||
resolve();
|
||||
}));
|
||||
} else {
|
||||
@@ -229,7 +241,9 @@ export default {
|
||||
}
|
||||
// console.log('type', type, 'data', data)
|
||||
// pass datas to parent
|
||||
this.$emit('saveFormOnTheFly', { type: type, data: data });
|
||||
if (this.action != 'addContact') {
|
||||
this.$emit('saveFormOnTheFly', { type: type, data: data });
|
||||
}
|
||||
|
||||
this.modal.showModal = false;
|
||||
},
|
||||
|
Reference in New Issue
Block a user