Verbessere die Sichtbarkeit von Mitgliederdaten, indem das Geburtsdatum im Edit-Formular hinzugefügt wird
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 52s

This commit is contained in:
Torsten Schulz (local)
2026-02-14 03:05:15 +01:00
parent d37f182928
commit 08624cabbe

View File

@@ -215,22 +215,22 @@ export default defineEventHandler(async (event) => {
const contactHidden = (!emailVisible && hadEmail) || (!phoneVisible && hadPhone) || (!addressVisible && hadAddress) const contactHidden = (!emailVisible && hadEmail) || (!phoneVisible && hadPhone) || (!addressVisible && hadAddress)
return { return {
id: member.id, id: member.id,
name: member.name, name: member.name,
source: member.source, source: member.source,
editable: member.editable, editable: member.editable,
hasLogin: member.hasLogin, hasLogin: member.hasLogin,
loginRoles: member.loginRoles, loginRoles: member.loginRoles,
loginRole: member.loginRole, loginRole: member.loginRole,
lastLogin: member.lastLogin, lastLogin: member.lastLogin,
isMannschaftsspieler: member.isMannschaftsspieler, isMannschaftsspieler: member.isMannschaftsspieler,
notes: member.notes || '', notes: member.notes || '',
// Privileged viewers (vorstand) always see contact fields // Privileged viewers (vorstand) always see contact fields
email: emailVisible ? member.email : undefined, email: emailVisible ? member.email : undefined,
phone: phoneVisible ? member.phone : undefined, phone: phoneVisible ? member.phone : undefined,
address: addressVisible ? member.address : undefined, address: addressVisible ? member.address : undefined,
// Birthday: expose only day + month and only if allowed; do not expose year or age // Birthday: expose only day + month and only if allowed; do not expose year or age
birthday: (birthdayVisible && hadBirthday) ? (function(){ birthday: (birthdayVisible && hadBirthday) ? (function(){
try { try {
const d = new Date(member.geburtsdatum) const d = new Date(member.geburtsdatum)
if (isNaN(d.getTime())) return undefined if (isNaN(d.getTime())) return undefined
@@ -241,10 +241,11 @@ export default defineEventHandler(async (event) => {
return undefined return undefined
} }
})() : undefined, })() : undefined,
// Flag for UI: data existed but is hidden to the current viewer geburtsdatum: member.geburtsdatum || undefined, // Originalfeld für das Edit-Formular
contactHidden // Flag for UI: data existed but is hidden to the current viewer
} contactHidden
}) }
})
return { return {
success: true, success: true,