feat(imports): import history and delete by import

Track imports in DB, show history in Data section, allow deleting
transactions of a specific import instead of clearing all.
This commit is contained in:
Anton
2026-03-16 17:46:15 +03:00
parent f32a21f87a
commit 01b1f26553
13 changed files with 331 additions and 6 deletions

View File

@@ -1,4 +1,7 @@
import type { ImportStatementResponse } from '@family-budget/shared';
import type {
ImportStatementResponse,
Import,
} from '@family-budget/shared';
import { api } from './client';
export async function importStatement(
@@ -11,3 +14,13 @@ export async function importStatement(
formData,
);
}
export async function getImports(): Promise<Import[]> {
return api.get<Import[]>('/api/imports');
}
export async function deleteImport(
id: number,
): Promise<{ deleted: number }> {
return api.delete<{ deleted: number }>(`/api/imports/${id}`);
}