rebuild app as turbopack-first single-stack with internal api and openclaw tasks
This commit is contained in:
17
frontend/app/api/tasks/[taskId]/route.ts
Normal file
17
frontend/app/api/tasks/[taskId]/route.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { jsonError } from '@/lib/server/http';
|
||||
import { getTaskById } from '@/lib/server/tasks';
|
||||
|
||||
type Context = {
|
||||
params: Promise<{ taskId: string }>;
|
||||
};
|
||||
|
||||
export async function GET(_request: Request, context: Context) {
|
||||
const { taskId } = await context.params;
|
||||
const task = await getTaskById(taskId);
|
||||
|
||||
if (!task) {
|
||||
return jsonError('Task not found', 404);
|
||||
}
|
||||
|
||||
return Response.json({ task });
|
||||
}
|
||||
Reference in New Issue
Block a user