From ca6bfea51fcafd3dd1473db6dcadb9e291b03479 Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 18 Feb 2022 14:17:39 +0100 Subject: [PATCH] Create 3rd party contact: fix adding civility and profession to payload --- .../vuejs/OnTheFly/components/OnTheFly.vue | 9 +- .../_components/AddPersons/TypeThirdParty.vue | 112 ------------------ 2 files changed, 7 insertions(+), 114 deletions(-) delete mode 100644 src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeThirdParty.vue diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue index 537cce4c2..061c9860b 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue @@ -232,13 +232,18 @@ export default { "name": data.text, "isChild": true, "parent": {"type": "thirdparty", "id": this.parent.id}, - "civility": {"id": data.civility}, - "profession": {"id": data.profession}, "comment": data.comment, "telephone": data.phonenumber, "email": data.email, "address": this.parent.address } + if ("civility" in data) { + Object.assign(data, {"civility": {"id": data.civility}} ) + } + if ("profession" in data) { + Object.assign(data, {"profession": {"id": data.profession}} ) + } + } else { type = this.$refs.castNew.radioType; data = this.$refs.castNew.castDataByType(); diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeThirdParty.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeThirdParty.vue deleted file mode 100644 index 13574a8b6..000000000 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeThirdParty.vue +++ /dev/null @@ -1,112 +0,0 @@ - - - - -