feat: re-run and delete scan from detail page

Backend:
- DELETE /api/v1/scans/{id} — 204 on success, 404 if missing,
  409 if pending/running; CASCADE removes routes and flights

Frontend (api.ts):
- scanApi.delete(id)

Frontend (ScanDetails.tsx):
- Re-run button: derives window_months from stored dates, detects
  country vs airports mode via comma in scan.country, creates new
  scan and navigates to it; disabled while scan is active
- Delete button: inline two-step confirm (no modal), navigates to
  dashboard on success; disabled while scan is active

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-27 16:33:45 +01:00
parent f9411edd3c
commit 4926e89e46
3 changed files with 125 additions and 0 deletions

View File

@@ -123,6 +123,8 @@ export const scanApi = {
if (destination) params.destination = destination;
return api.get<PaginatedResponse<Flight>>(`/scans/${id}/flights`, { params });
},
delete: (id: number) => api.delete(`/scans/${id}`),
};
export const airportApi = {