实现博客评论
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import { BlogComment } from "@/lib/types/blogComment";
|
||||
import fetcher from "../fetcher";
|
||||
|
||||
export async function createComment(blogId: string, content: string) {
|
||||
export async function createComment(blogId: string, content: string, parentId?: string) {
|
||||
return fetcher<BlogComment>(`/api/blog/${blogId}/comment`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ content }),
|
||||
body: JSON.stringify({
|
||||
content,
|
||||
parentId: parentId || null,
|
||||
}),
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user