fix(admin-web): fix agent-evals run endpoint + disable delete (no backend)

- B18: POST /agent-evals/suites/:id/run → /suites/:id/runs (plural)
- B19: DELETE /agent-evals/suites/:id has no backend endpoint — disabled with TODO Q3
This commit is contained in:
saravanakumardb1 2026-03-21 21:14:52 -07:00
parent 587d22e107
commit c54a3fe277

View File

@ -11,7 +11,6 @@ import {
CheckCircle2,
XCircle,
Clock,
Trash2,
} from 'lucide-react';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { Badge } from '@/components/ui/badge';
@ -104,15 +103,17 @@ export default function AgentEvalsPage() {
}
async function handleRun(id: string) {
await apiFetch(`suites/${id}/run`, { method: 'POST' });
await apiFetch(`suites/${id}/runs`, { method: 'POST' });
loadData();
}
async function handleDelete(id: string) {
if (!confirm('Delete this evaluation suite?')) return;
await apiFetch(`suites/${id}`, { method: 'DELETE' });
loadData();
}
// TODO Q3: Backend has no DELETE /agent-evals/suites/:id endpoint.
// When suite deletion is implemented, uncomment this.
// async function handleDelete(id: string) {
// if (!confirm('Delete this evaluation suite?')) return;
// await apiFetch(`suites/${id}`, { method: 'DELETE' });
// loadData();
// }
const passedCount = suites.filter(s => s.lastRunStatus === 'passed').length;
const failedCount = suites.filter(s => s.lastRunStatus === 'failed').length;
@ -244,13 +245,7 @@ export default function AgentEvalsPage() {
<Play className="mr-2 h-4 w-4" />
Run
</DropdownMenuItem>
<DropdownMenuItem
onClick={() => handleDelete(s.id)}
className="text-destructive"
>
<Trash2 className="mr-2 h-4 w-4" />
Delete
</DropdownMenuItem>
{/* TODO Q3: Delete disabled — no backend endpoint yet */}
</DropdownMenuContent>
</DropdownMenu>
</TableCell>