Files
learnharness/app/api/chats/[id]/route.ts
T

9 lines
296 B
TypeScript
Raw Normal View History

import { getChat } from "@/src/server";
export async function GET(_req: Request, { params }: { params: Promise<{ id: string }> }) {
const { id } = await params;
const chat = getChat(id);
if (!chat) return Response.json({ error: "Not found" }, { status: 404 });
return Response.json(chat);
}