Take Null value for gender into account and fix OnTheFly makeFetch

This commit is contained in:
2024-10-22 14:39:17 +02:00
parent 30b66d5806
commit 588f02cdf4
6 changed files with 17 additions and 13 deletions

View File

@@ -24,12 +24,12 @@ const getCivilities = () =>
throw Error('Error with request resource response');
});
const getGenders = () =>
makeFetch("GET", '/api/1.0/main/gender.json').
.then(response => {
if (response.ok) { return response.json(); }
throw Error('Error with request resource response');
});
const getGenders = () => makeFetch("GET", '/api/1.0/main/gender.json')
// .then(response => {
// console.log(response)
// if (response.ok) { return response.json(); }
// throw Error('Error with request resource response');
// });
const getCentersForPersonCreation = () => makeFetch('GET', '/api/1.0/person/creation/authorized-centers', null);

View File

@@ -39,7 +39,7 @@
<p v-if="options.addInfo === true" class="moreinfo">
<gender-icon-render-box v-if="person.gender" :gender="person.gender"></gender-icon-render-box>
<time v-if="person.birthdate && !person.deathdate" :datetime="person.birthdate" :title="birthdate">
{{ $t(`renderbox.birthday.${person.gender.genderTranslation}`) + ' ' + $d(birthdate, 'text') }}
{{ $t(person.gender ? `renderbox.birthday.${person.gender.genderTranslation}` : 'renderbox.birthday.neutral') + ' ' + $d(birthdate, 'text') }}
</time>
<time v-else-if="person.birthdate && person.deathdate" :datetime="person.deathdate"