mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
conditional statements to allow for personne moral creation and edit
This commit is contained in:
parent
688914906d
commit
06cc84a21f
@ -229,11 +229,18 @@ export default {
|
|||||||
data = this.$refs.castThirdparty.$data.thirdparty;
|
data = this.$refs.castThirdparty.$data.thirdparty;
|
||||||
// console.log('data original', data);
|
// console.log('data original', data);
|
||||||
data.parent = {type: "thirdparty", id: this.parent.id};
|
data.parent = {type: "thirdparty", id: this.parent.id};
|
||||||
|
data.civility = {type: 'chill_main_civility', id: data.civility.id};
|
||||||
|
data.profession = {type: 'third_party_profession', id: data.profession.id};
|
||||||
} else {
|
} else {
|
||||||
type = this.$refs.castNew.radioType;
|
type = this.$refs.castNew.radioType;
|
||||||
data = this.$refs.castNew.castDataByType();
|
data = this.$refs.castNew.castDataByType();
|
||||||
data.civility = {type: 'chill_main_civility', id: data.civility.id};
|
// console.log('type', type);
|
||||||
data.profession = {type: 'third_party_profession', id: data.profession.id};
|
if (null !== data.civility) {
|
||||||
|
data.civility = {type: 'chill_main_civility', id: data.civility.id};
|
||||||
|
}
|
||||||
|
if (null !== data.profession) {
|
||||||
|
data.profession = {type: 'third_party_profession', id: data.profession.id};
|
||||||
|
}
|
||||||
// console.log('onthefly data', data);
|
// console.log('onthefly data', data);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -172,11 +172,14 @@ export default {
|
|||||||
body.name = payload.data.name;
|
body.name = payload.data.name;
|
||||||
body.email = payload.data.email;
|
body.email = payload.data.email;
|
||||||
body.telephone = payload.data.telephone;
|
body.telephone = payload.data.telephone;
|
||||||
body.civility = {type: 'chill_main_civility', id: payload.data.civility.id};
|
|
||||||
body.profession = {type: 'third_party_profession', id: payload.data.profession.id};
|
|
||||||
body.address = payload.data.address ? { id: payload.data.address.address_id } : null;
|
body.address = payload.data.address ? { id: payload.data.address.address_id } : null;
|
||||||
|
if (null !== payload.data.civility) {
|
||||||
console.log('body', body);
|
body.civility = {type: 'chill_main_civility', id: payload.data.civility.id};
|
||||||
|
}
|
||||||
|
if (null !== payload.data.profession) {
|
||||||
|
body.profession = {type: 'third_party_profession', id: payload.data.profession.id};
|
||||||
|
}
|
||||||
|
// console.log('body', body);
|
||||||
|
|
||||||
makeFetch('PATCH', `/api/1.0/thirdparty/thirdparty/${payload.data.id}.json`, body)
|
makeFetch('PATCH', `/api/1.0/thirdparty/thirdparty/${payload.data.id}.json`, body)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
@ -65,7 +65,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="thirdparty.kind === 'child' || thirdparty.kind === 'contact'">
|
<div v-if="thirdparty.kind === 'child' || thirdparty.kind === 'contact'">
|
||||||
<div id="child-info">
|
<div class="child-info">
|
||||||
<div class="input-group mb-3 input-section">
|
<div class="input-group mb-3 input-section">
|
||||||
<select class="form-select form-select-lg" id="civility"
|
<select class="form-select form-select-lg" id="civility"
|
||||||
v-model="thirdparty.civility">
|
v-model="thirdparty.civility">
|
||||||
@ -356,5 +356,6 @@ dl {
|
|||||||
width: 49%;
|
width: 49%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user