bug fix for atemschutz
This commit is contained in:
@@ -59,8 +59,10 @@ class AtemschutzController {
|
||||
|
||||
async create(req: Request, res: Response): Promise<void> {
|
||||
try {
|
||||
logger.info('Atemschutz create - raw body:', { body: req.body });
|
||||
const parsed = CreateAtemschutzSchema.safeParse(req.body);
|
||||
if (!parsed.success) {
|
||||
logger.warn('Atemschutz create - validation failed:', { errors: parsed.error.flatten() });
|
||||
res.status(400).json({
|
||||
success: false,
|
||||
message: 'Validierungsfehler',
|
||||
@@ -68,6 +70,7 @@ class AtemschutzController {
|
||||
});
|
||||
return;
|
||||
}
|
||||
logger.info('Atemschutz create - parsed data:', { data: parsed.data });
|
||||
const record = await atemschutzService.create(parsed.data, getUserId(req));
|
||||
res.status(201).json({ success: true, data: record });
|
||||
} catch (error: any) {
|
||||
|
||||
Reference in New Issue
Block a user