39 lines
897 B
TypeScript
39 lines
897 B
TypeScript
import {
|
|
httpDeleteInterceptor,
|
|
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`;
|
|
const headers = {
|
|
"Content-Type": "multipart/form-data",
|
|
};
|
|
return httpPostInterceptor(url, data, headers);
|
|
}
|
|
|
|
export async function deleteBlog(id: any) {
|
|
const url = `blog?id=${id}`;
|
|
return httpDeleteInterceptor(url);
|
|
}
|