fix(07): CR-01 rename import return field imported→count to match frontend
Backend dkv.service.ts returned { imported } but frontend read result.count,
causing the success toast to always display "undefined Fahrzeuge importiert".
Align backend field name to count and update the dkv-api.ts return type to
include mode for completeness.
This commit is contained in:
@@ -498,7 +498,7 @@ export class DkvService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.logger.log(`DKV CSV import: ${vehicles.length} vehicles, mode=${mode}, tenant=${tenantId}`);
|
this.logger.log(`DKV CSV import: ${vehicles.length} vehicles, mode=${mode}, tenant=${tenantId}`);
|
||||||
return { imported: vehicles.length, mode };
|
return { count: vehicles.length, mode };
|
||||||
}
|
}
|
||||||
|
|
||||||
// ─── History ─────────────────────────────────────────────────────────────────
|
// ─── History ─────────────────────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ export async function deleteVehicle(id: string): Promise<void> {
|
|||||||
export async function importVehiclesCsv(
|
export async function importVehiclesCsv(
|
||||||
file: File,
|
file: File,
|
||||||
mode: 'merge' | 'replace',
|
mode: 'merge' | 'replace',
|
||||||
): Promise<{ count: number }> {
|
): Promise<{ count: number; mode: string }> {
|
||||||
const form = new FormData();
|
const form = new FormData();
|
||||||
form.append('file', file);
|
form.append('file', file);
|
||||||
form.append('mode', mode);
|
form.append('mode', mode);
|
||||||
|
|||||||
Reference in New Issue
Block a user