blob: c1d00c05e0b86746d84114884095d1c2e5e2bae3 [file] [log] [blame]
Akane121765b61a72025-05-17 13:52:25 +08001import { api } from './auth';
2
3export const likePostComment = (commentId) => {
4 return api.post(`/help/comments/${commentId}/like`);
5};
6
7export const getCommentReplies = (commentId) => {
8 return api.get(`/help/comments/${commentId}/replies`);
9};
10
11export const addCommentReply = (commentId, replyData) => {
Akane1217d1e9f712025-05-29 14:36:56 +080012 const formData = new FormData();
13 formData.append('authorId', replyData.authorId);
14 formData.append('content', replyData.content);
15
16 // 如果有图片,添加到formData
17 if (replyData.image) {
18 formData.append('image', replyData.image);
19 }
20
21 return api.post(`/help/comments/${commentId}/replies`, formData);
22};
23
24export const deleteComment = (commentId, authorId) => {
25 return api.delete(`/help/comments/${commentId}`, {
26 params: { authorId }
27 });
Akane121765b61a72025-05-17 13:52:25 +080028};