featuer change for calendar
This commit is contained in:
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user