import api from "@/lib/api"; export interface Comment { id: string; text: string; parentId?: string; likesCount: number; isLiked: boolean; createdAt: string; updatedAt: string; user: { uuid: string; username: string; displayName?: string; avatarUrl?: string; }; } export const CommentService = { async getByContentId(contentId: string): Promise { const { data } = await api.get(`/contents/${contentId}/comments`); return data; }, async create( contentId: string, text: string, parentId?: string, ): Promise { const { data } = await api.post(`/contents/${contentId}/comments`, { text, parentId, }); return data; }, async remove(commentId: string): Promise { await api.delete(`/comments/${commentId}`); }, async like(commentId: string): Promise { await api.post(`/comments/${commentId}/like`); }, async unlike(commentId: string): Promise { await api.delete(`/comments/${commentId}/like`); }, };