Add birthdate handling in member registration and management. Update UI to conditionally require birthdate for new members, and enhance API to enforce birthdate validation. Improve tests to cover new birthdate requirements.
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 57s

This commit is contained in:
Torsten Schulz (local)
2026-03-31 07:25:44 +02:00
parent 8ffd267dfc
commit 0fb58af194
9 changed files with 98 additions and 12 deletions

View File

@@ -5,12 +5,12 @@ import { assertPasswordNotPwned } from '../../utils/hibp.js'
export default defineEventHandler(async (event) => {
try {
const body = await readBody(event)
const { name, email, phone, password } = body
const { name, email, phone, password, geburtsdatum, visibility } = body
if (!name || !email || !password) {
if (!name || !email || !password || !geburtsdatum) {
throw createError({
statusCode: 400,
message: 'Name, E-Mail und Passwort sind erforderlich'
message: 'Name, E-Mail, Geburtsdatum und Passwort sind erforderlich'
})
}
@@ -46,6 +46,10 @@ export default defineEventHandler(async (event) => {
password: hashedPassword,
name,
phone: phone || '',
geburtsdatum,
visibility: {
showBirthday: visibility?.showBirthday !== undefined ? Boolean(visibility.showBirthday) : true
},
role: 'mitglied',
active: false, // Requires admin approval
created: new Date().toISOString(),