import api from '@/lib/api-client'; import { IComment, IResolveComment } from '@/features/comment/types/comment.types'; export async function createComment(data: Partial): Promise { const req = await api.post('/comments/create', data); return req.data as IComment; } export async function resolveComment(data: IResolveComment): Promise { const req = await api.post(`/comments/resolve`, data); return req.data as IComment; } export async function updateComment(data: Partial): Promise { const req = await api.post(`/comments/update`, data); return req.data as IComment; } export async function getCommentById(id: string): Promise { const req = await api.post('/comments/view', { id }); return req.data as IComment; } export async function getPageComments(pageId: string): Promise { const req = await api.post('/comments', { pageId }); return req.data as IComment[]; } export async function deleteComment(id: string): Promise { await api.post('/comments/delete', { id }); }