mediahub-fe/service/blog/blog.ts

27 lines
675 B
TypeScript
Raw Normal View History

2025-01-01 17:48:57 +00:00
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}`
);
}
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
}
export async function getBlog(id: any) {
const url = `blog/${id}`;
2025-01-01 17:48:57 +00:00
return httpGetInterceptor(url);
}
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);
}