[taskboard] add dispatch control plane
This commit is contained in:
16
app/api/tasks/[id]/events/route.ts
Normal file
16
app/api/tasks/[id]/events/route.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
import { listTaskEvents } from "@/lib/tasks";
|
||||
|
||||
export async function GET(
|
||||
_request: Request,
|
||||
{ params }: { params: Promise<{ id: string }> },
|
||||
) {
|
||||
const { id } = await params;
|
||||
const numericId = Number(id);
|
||||
if (!Number.isInteger(numericId) || numericId <= 0) {
|
||||
return NextResponse.json({ error: "invalid_task_id" }, { status: 400 });
|
||||
}
|
||||
|
||||
return NextResponse.json(await listTaskEvents(numericId, 50));
|
||||
}
|
||||
Reference in New Issue
Block a user