import { httpGetInterceptor, httpPostInterceptor } from "../http-config/http-interceptor-service";

export async function paginationBlog(
  size: number,
  page: number,
  title: string = ""
) {
  return await httpGetInterceptor(
    `blog/pagination?enablePage=1&page=${page}&size=${size}&title=${title}`
  );
}

export async function postBlog(data: any) {
  const url = "blog";
  return httpPostInterceptor(url, data);
}

export async function getBlog(id: any) {
  const url = `blog/${id}`;
  return httpGetInterceptor(url);
}

export async function uploadThumbnailBlog(id: any, data: any) {
  const url = `blog/${id}/thumbnail`;
  return httpPostInterceptor(url, data);
}
