2025-01-01 17:48:57 +00:00
|
|
|
import { httpGetInterceptor, httpPostInterceptor } from "../http-config/http-interceptor-service";
|
2024-12-04 17:28:40 +00:00
|
|
|
|
2024-12-11 18:28:57 +00:00
|
|
|
export async function paginationBlog(
|
|
|
|
|
size: number,
|
|
|
|
|
page: number,
|
|
|
|
|
title: string = ""
|
|
|
|
|
) {
|
2024-12-04 17:28:40 +00:00
|
|
|
return await httpGetInterceptor(
|
2024-12-11 18:28:57 +00:00
|
|
|
`blog/pagination?enablePage=1&page=${page}&size=${size}&title=${title}`
|
2024-12-04 17:28:40 +00:00
|
|
|
);
|
|
|
|
|
}
|
2024-12-16 14:05:10 +00:00
|
|
|
|
|
|
|
|
export async function postBlog(data: any) {
|
|
|
|
|
const url = "blog";
|
2025-01-01 17:48:57 +00:00
|
|
|
return httpPostInterceptor(url, data);
|
2024-12-16 14:05:10 +00:00
|
|
|
}
|
2024-12-18 19:03:22 +00:00
|
|
|
|
|
|
|
|
export async function getBlog(id: any) {
|
|
|
|
|
const url = `blog/${id}`;
|
2025-01-01 17:48:57 +00:00
|
|
|
return httpGetInterceptor(url);
|
2024-12-18 19:03:22 +00:00
|
|
|
}
|
2024-12-23 18:38:25 +00:00
|
|
|
|
|
|
|
|
export async function uploadThumbnailBlog(id: any, data: any) {
|
|
|
|
|
const url = `blog/${id}/thumbnail`;
|
2025-01-01 17:48:57 +00:00
|
|
|
return httpPostInterceptor(url, data);
|
2024-12-23 18:38:25 +00:00
|
|
|
}
|