blob: 2ff9adeb4b5c9d39cbead7d58eb856641f2f8089 [file] [log] [blame]
Akane121765b61a72025-05-17 13:52:25 +08001import { api } from './auth';
2
DREWae420b22025-06-02 14:07:20 +08003export const likeHelpPostComment = (commentId) => {
Akane121765b61a72025-05-17 13:52:25 +08004 return api.post(`/help/comments/${commentId}/like`);
5};
6
DREWae420b22025-06-02 14:07:20 +08007export const getHelpCommentReplies = (commentId) => {
Akane121765b61a72025-05-17 13:52:25 +08008 return api.get(`/help/comments/${commentId}/replies`);
9};
10
DREWae420b22025-06-02 14:07:20 +080011export const addHelpCommentReply = (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
DREWae420b22025-06-02 14:07:20 +080024export const deleteHelpComment = (commentId, authorId) => {
Akane1217d1e9f712025-05-29 14:36:56 +080025 return api.delete(`/help/comments/${commentId}`, {
26 params: { authorId }
27 });
Akane121765b61a72025-05-17 13:52:25 +080028};