Files
tonePage/tone-page-web/lib/api/blog/createComment.ts
2025-06-07 15:19:43 +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,
}),
});
}