mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
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:
@@ -100,6 +100,7 @@ import Modal from 'ChillMainAssets/vuejs/_components/Modal.vue';
|
||||
import OnTheFlyCreate from './Create.vue';
|
||||
import OnTheFlyPerson from 'ChillPersonAssets/vuejs/_components/OnTheFly/Person.vue';
|
||||
import OnTheFlyThirdparty from 'ChillThirdPartyAssets/vuejs/_components/OnTheFly/ThirdParty.vue';
|
||||
import { postThirdparty } from "ChillThirdPartyAssets/vuejs/_api/OnTheFly";
|
||||
|
||||
export default {
|
||||
name: 'OnTheFly',
|
||||
@@ -219,16 +220,23 @@ export default {
|
||||
if (this.action === 'addContact') {
|
||||
type = 'thirdparty'
|
||||
data = this.$refs.castThirdparty.$data.thirdparty;
|
||||
// console.log(data)
|
||||
// create the new contact here, bypassing saveFormOnTheFly() -> not working here?
|
||||
console.log('addContact data', data)
|
||||
postThirdparty(data)
|
||||
.then(thirdparty => new Promise((resolve, reject) => {
|
||||
this.newPriorSuggestion(thirdparty);
|
||||
resolve();
|
||||
}));
|
||||
} else {
|
||||
type = this.$refs.castNew.radioType;
|
||||
data = this.$refs.castNew.castDataByType();
|
||||
console.log(data)
|
||||
}
|
||||
} else {
|
||||
throw 'error with object type';
|
||||
}
|
||||
}
|
||||
console.log('type', type, 'data', data)
|
||||
// console.log('type', type, 'data', data)
|
||||
// pass datas to parent
|
||||
this.$emit('saveFormOnTheFly', { type: type, data: data });
|
||||
|
||||
|
Reference in New Issue
Block a user