fix bug when setting civility to null in on the fly

This commit is contained in:
Julien Fastré 2022-03-24 19:32:53 +01:00
parent 1031f0d40e
commit dd4d463c42

View File

@ -229,18 +229,14 @@ export default {
data = this.$refs.castThirdparty.$data.thirdparty;
// console.log('data original', data);
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};
data.civility = data.civility !== null ? {type: 'chill_main_civility', id: data.civility.id} : null;
data.profession = data.profession !== null ? {type: 'third_party_profession', id: data.profession.id} : null;
} else {
type = this.$refs.castNew.radioType;
data = this.$refs.castNew.castDataByType();
// console.log('type', type);
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};
}
data.civility = data.civility !== null ? {type: 'chill_main_civility', id: data.civility.id} : null;
data.profession = data.profession !== null ? {type: 'third_party_profession', id: data.profession.id} : null;
// console.log('onthefly data', data);
}
} else {