/**
 * Per-session proxy to chat-standalone:
 *   GET    /api/chat/sessions/<id>     { session, messages }
 *   PATCH  /api/chat/sessions/<id>     partial update
 *   DELETE /api/chat/sessions/<id>     cascade delete
 */

import { proxyToChat } from '@/lib/chat/proxy';

export async function GET(req: Request, { params }: { params: Promise<{ id: string }> }) {
  const { id } = await params;
  return proxyToChat(req, `/api/sessions/${encodeURIComponent(id)}`);
}

export async function PATCH(req: Request, { params }: { params: Promise<{ id: string }> }) {
  const { id } = await params;
  return proxyToChat(req, `/api/sessions/${encodeURIComponent(id)}`);
}

export async function DELETE(req: Request, { params }: { params: Promise<{ id: string }> }) {
  const { id } = await params;
  return proxyToChat(req, `/api/sessions/${encodeURIComponent(id)}`);
}
