new features
This commit is contained in:
@@ -364,7 +364,7 @@ class BestellungController {
|
||||
res.status(400).json({ success: false, message: 'Ungültige Bestellungs-ID' });
|
||||
return;
|
||||
}
|
||||
const { nachricht, faellig_am } = req.body;
|
||||
const { faellig_am } = req.body;
|
||||
if (!faellig_am) {
|
||||
res.status(400).json({ success: false, message: 'Fälligkeitsdatum ist erforderlich' });
|
||||
return;
|
||||
|
||||
@@ -394,7 +394,8 @@ class EquipmentController {
|
||||
|
||||
async getStatusHistory(req: Request, res: Response): Promise<void> {
|
||||
try {
|
||||
const history = await equipmentService.getStatusHistory(req.params.id);
|
||||
const { id } = req.params as Record<string, string>;
|
||||
const history = await equipmentService.getStatusHistory(id);
|
||||
res.status(200).json({ success: true, data: history });
|
||||
} catch (error) {
|
||||
logger.error('getStatusHistory error', { error, id: req.params.id });
|
||||
@@ -403,8 +404,9 @@ class EquipmentController {
|
||||
}
|
||||
|
||||
async uploadWartungFile(req: Request, res: Response): Promise<void> {
|
||||
const wartungId = parseInt(req.params.wartungId, 10);
|
||||
if (isNaN(wartungId)) {
|
||||
const { wartungId } = req.params as Record<string, string>;
|
||||
const id = parseInt(wartungId, 10);
|
||||
if (isNaN(id)) {
|
||||
res.status(400).json({ success: false, message: 'Ungültige Wartungs-ID' });
|
||||
return;
|
||||
}
|
||||
@@ -414,7 +416,7 @@ class EquipmentController {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const result = await equipmentService.updateWartungslogFile(wartungId, file.path);
|
||||
const result = await equipmentService.updateWartungslogFile(id, file.path);
|
||||
res.status(200).json({ success: true, data: result });
|
||||
} catch (error) {
|
||||
logger.error('uploadWartungFile error', { error, wartungId });
|
||||
|
||||
@@ -375,7 +375,8 @@ class VehicleController {
|
||||
|
||||
async getStatusHistory(req: Request, res: Response): Promise<void> {
|
||||
try {
|
||||
const history = await vehicleService.getStatusHistory(req.params.id);
|
||||
const { id } = req.params as Record<string, string>;
|
||||
const history = await vehicleService.getStatusHistory(id);
|
||||
res.status(200).json({ success: true, data: history });
|
||||
} catch (error) {
|
||||
logger.error('getStatusHistory error', { error, id: req.params.id });
|
||||
@@ -384,8 +385,9 @@ class VehicleController {
|
||||
}
|
||||
|
||||
async uploadWartungFile(req: Request, res: Response): Promise<void> {
|
||||
const wartungId = parseInt(req.params.wartungId, 10);
|
||||
if (isNaN(wartungId)) {
|
||||
const { wartungId } = req.params as Record<string, string>;
|
||||
const id = parseInt(wartungId, 10);
|
||||
if (isNaN(id)) {
|
||||
res.status(400).json({ success: false, message: 'Ungültige Wartungs-ID' });
|
||||
return;
|
||||
}
|
||||
@@ -395,7 +397,7 @@ class VehicleController {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const result = await vehicleService.updateWartungslogFile(wartungId, file.path);
|
||||
const result = await vehicleService.updateWartungslogFile(id, file.path);
|
||||
res.status(200).json({ success: true, data: result });
|
||||
} catch (error) {
|
||||
logger.error('uploadWartungFile error', { error, wartungId });
|
||||
|
||||
Reference in New Issue
Block a user