实现评论本地更新
This commit is contained in:
@@ -1,14 +1,8 @@
|
||||
import { BlogComment } from "@/lib/types/blogComment";
|
||||
import fetcher from "../fetcher";
|
||||
|
||||
export async function createComment(blogId: string, content: string) {
|
||||
return fetcher<{
|
||||
blogId: string;
|
||||
content: string;
|
||||
createdAt: string
|
||||
deletedAt: null; // 原则上能看到就是null
|
||||
id: string;
|
||||
parentId: string | null;
|
||||
}>(`/api/blog/${blogId}/comment`, {
|
||||
return fetcher<BlogComment>(`/api/blog/${blogId}/comment`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ content }),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user