Files
tonePage/apps/frontend/lib/api/blog/createComment.ts
2025-12-12 17:25:26 +08:00

12 lines
382 B
TypeScript

import { BlogComment } from "@/lib/types/blogComment";
import fetcher from "../fetcher";
export async function createComment(blogId: string, content: string, parentId?: string) {
return fetcher<BlogComment>(`/api/blog/${blogId}/comment`, {
method: 'POST',
body: JSON.stringify({
content,
parentId: parentId || null,
}),
});
}