featuer change for calendar

This commit is contained in:
Matthias Hochmeister
2026-03-03 08:57:32 +01:00
parent ad069fde10
commit 146f79cf00
9 changed files with 617 additions and 64 deletions

View File

@@ -116,6 +116,22 @@ class AtemschutzController {
}
}
async getMyStatus(req: Request, res: Response): Promise<void> {
try {
const userId = getUserId(req);
const record = await atemschutzService.getByUserId(userId);
if (!record) {
// User has no atemschutz entry — not an error, just no data
res.status(200).json({ success: true, data: null });
return;
}
res.status(200).json({ success: true, data: record });
} catch (error) {
logger.error('Atemschutz getMyStatus error', { error });
res.status(500).json({ success: false, message: 'Persönlicher Atemschutz-Status konnte nicht geladen werden' });
}
}
async delete(req: Request, res: Response): Promise<void> {
try {
const { id } = req.params as Record<string, string>;