import { httpDeleteInterceptor, httpGet, httpPost, httpPut, } from "./http-config/axios-base-service"; import Cookies from "js-cookie"; const token = Cookies.get("access_token"); export async function getComments(data: any) { const headers = { "content-type": "application/json", }; const pathUrl = `/article-comments?page=${data?.page || 1}&limit=${ data?.limit || "" }&message=${data?.search || ""}&parentId=0`; return await httpGet(pathUrl, headers); } export async function deleteComment(id: number) { const headers = { "content-type": "application/json", }; return await httpDeleteInterceptor(`/article-comments/${id}`, headers); } export async function getCommentById(id: number) { const headers = { "content-type": "application/json", }; const pathUrl = `/article-comments/${id}`; return await httpGet(pathUrl, headers); } export async function saveCommentStatus(data: { id: number; statusId: number; }) { const headers = { "content-type": "application/json", }; const pathUrl = `/article-comments/approval`; return await httpPost(pathUrl, headers, data); }