Files
role-user/src/app/api/mobile/tasks/[id]/comment/route.ts
T
2026-06-02 14:46:39 +08:00

17 lines
436 B
TypeScript

import { proxyBackendJson } from "@/lib/backend";
import type { TaskDetail } from "@/lib/types";
type Params = {
params: Promise<{ id: string }>;
};
export async function POST(request: Request, { params }: Params) {
const { id } = await params;
const body = await request.text();
return proxyBackendJson<TaskDetail>(`/mobile/tasks/${encodeURIComponent(id)}/comment`, {
method: "POST",
body: body || undefined
});
}