new features
This commit is contained in:
@@ -396,8 +396,9 @@ class VehicleService {
|
||||
|
||||
// Auto-update next service date on the vehicle when result is 'bestanden'
|
||||
if (data.ergebnis === 'bestanden' && data.naechste_faelligkeit) {
|
||||
const column = data.art === '§57a Prüfung' ? 'paragraph57a_faellig_am' : 'naechste_wartung_am';
|
||||
await pool.query(
|
||||
`UPDATE fahrzeuge SET naechste_wartung_am = $1 WHERE id = $2`,
|
||||
`UPDATE fahrzeuge SET ${column} = $1 WHERE id = $2`,
|
||||
[data.naechste_faelligkeit, fahrzeugId]
|
||||
);
|
||||
}
|
||||
@@ -443,8 +444,9 @@ class VehicleService {
|
||||
|
||||
// Auto-update next service date on the vehicle when result is 'bestanden'
|
||||
if (data.ergebnis === 'bestanden' && data.naechste_faelligkeit) {
|
||||
const column = data.art === '§57a Prüfung' ? 'paragraph57a_faellig_am' : 'naechste_wartung_am';
|
||||
await pool.query(
|
||||
`UPDATE fahrzeuge SET naechste_wartung_am = $1 WHERE id = $2`,
|
||||
`UPDATE fahrzeuge SET ${column} = $1 WHERE id = $2`,
|
||||
[data.naechste_faelligkeit, fahrzeugId]
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user