bugfix of double civility abbreviation after edit

This commit is contained in:
Julie Lenaerts 2022-01-24 14:44:53 +01:00
parent 0f2cbbe553
commit b87f14255d
4 changed files with 5 additions and 4 deletions

View File

@ -215,7 +215,7 @@ export default {
data = { data = {
"type": "thirdparty", "type": "thirdparty",
"kind": "child", "kind": "child",
"name": data.text, "name": data.name,
"isChild": true, "isChild": true,
"parent": {"type": "thirdparty", "id": this.parent.id}, "parent": {"type": "thirdparty", "id": this.parent.id},
"civility": {"id": data.civility}, "civility": {"id": data.civility},
@ -234,7 +234,7 @@ export default {
throw 'error with object type'; throw 'error with object type';
} }
} }
// console.log('type', type, 'data', data) console.log('type', type, 'data', data)
// pass datas to parent // pass datas to parent
this.$emit('saveFormOnTheFly', { type: type, data: data }); this.$emit('saveFormOnTheFly', { type: type, data: data });

View File

@ -405,7 +405,7 @@ let initPromise = Promise.all([scopesPromise, accompanyingCoursePromise])
})); }));
} }
else if (payload.type === 'thirdparty') { else if (payload.type === 'thirdparty') {
body.name = payload.data.text; body.name = payload.data.name;
body.email = payload.data.email; body.email = payload.data.email;
body.telephone = payload.data.phonenumber; body.telephone = payload.data.phonenumber;
body.address = { id: payload.data.address.address_id }; body.address = { id: payload.data.address.address_id };

View File

@ -84,7 +84,7 @@
</div> </div>
<div class="form-floating mb-3"> <div class="form-floating mb-3">
<input class="form-control form-control-lg" id="name" v-model="thirdparty.text" v-bind:placeholder="$t('thirdparty.name')" /> <input class="form-control form-control-lg" id="name" v-model="thirdparty.name" v-bind:placeholder="$t('thirdparty.name')" />
<label for="name">{{ $t('thirdparty.name') }}</label> <label for="name">{{ $t('thirdparty.name') }}</label>
</div> </div>

View File

@ -36,6 +36,7 @@ class ThirdPartyNormalizer implements NormalizerAwareInterface, NormalizerInterf
{ {
return [ return [
'type' => 'thirdparty', 'type' => 'thirdparty',
'name' => $thirdParty->getName(),
'text' => $this->thirdPartyRender->renderString($thirdParty, []), 'text' => $this->thirdPartyRender->renderString($thirdParty, []),
'id' => $thirdParty->getId(), 'id' => $thirdParty->getId(),
'kind' => $thirdParty->getKind(), 'kind' => $thirdParty->getKind(),