feat: 优化项目目录结构
This commit is contained in:
12
apps/frontend/lib/api/blog/createComment.ts
Normal file
12
apps/frontend/lib/api/blog/createComment.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
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,
|
||||
}),
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user