2025-01-18 15:13:47 +00:00
|
|
|
import {
|
|
|
|
|
httpDeleteInterceptor,
|
|
|
|
|
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(
|
2025-04-03 15:43:04 +00:00
|
|
|
size: any,
|
2024-12-11 18:28:57 +00:00
|
|
|
page: number,
|
2025-01-26 13:21:48 +00:00
|
|
|
title: string = "",
|
|
|
|
|
categoryFilter: any,
|
|
|
|
|
statusFilter: any
|
2024-12-11 18:28:57 +00:00
|
|
|
) {
|
2024-12-04 17:28:40 +00:00
|
|
|
return await httpGetInterceptor(
|
2025-01-26 13:21:48 +00:00
|
|
|
`blog/pagination?enablePage=1&page=${page}&size=${size}&title=${title}&categoryId=${categoryFilter}&statusId=${statusFilter}`
|
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-18 15:13:47 +00:00
|
|
|
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);
|
2024-12-23 18:38:25 +00:00
|
|
|
}
|
2025-01-26 13:21:48 +00:00
|
|
|
|
|
|
|
|
export async function getBlogCategory() {
|
|
|
|
|
const url = "blog/categories/enable";
|
|
|
|
|
return httpGetInterceptor(url);
|
|
|
|
|
}
|
2025-07-25 08:17:35 +00:00
|
|
|
|
|
|
|
|
export async function publicListBlog(page: any, limit: any) {
|
|
|
|
|
const url = `blog/public/pagination?enablePage=1&page=${page}&size=${limit}`;
|
|
|
|
|
return httpGetInterceptor(url);
|
|
|
|
|
}
|