2025-01-03 21:18:22 +00:00
|
|
|
import {
|
|
|
|
|
httpDeleteInterceptor,
|
|
|
|
|
httpGetInterceptor,
|
|
|
|
|
httpPostInterceptor,
|
|
|
|
|
} from "../http-config/http-interceptor-service";
|
|
|
|
|
|
2025-01-07 12:59:32 +00:00
|
|
|
export async function getCategories(page: number) {
|
|
|
|
|
const url = `media/categories/list?enablePage=1&page=${page}&size=10&sort=desc&sortBy=id`;
|
2025-01-03 21:18:22 +00:00
|
|
|
return httpGetInterceptor(url);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function publishUnpublishCategory(id: number, status: string) {
|
|
|
|
|
const url = `media/categories/publish?id=${id}&status=${status}`;
|
|
|
|
|
return httpPostInterceptor(url);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function deleteCategory(id: number) {
|
|
|
|
|
const url = `media/categories/${id}`;
|
|
|
|
|
return httpDeleteInterceptor(url);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function getUserRoles() {
|
|
|
|
|
const url = "users/roles";
|
|
|
|
|
return httpGetInterceptor(url);
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-07 12:59:32 +00:00
|
|
|
export async function getCategoryDetail(id: string) {
|
|
|
|
|
const url = `media/categories/${id}`;
|
|
|
|
|
return httpGetInterceptor(url);
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-03 21:18:22 +00:00
|
|
|
export async function postCategory(data: any) {
|
|
|
|
|
const url = "media/categories";
|
2025-01-07 12:59:32 +00:00
|
|
|
const headers = {
|
|
|
|
|
"Content-Type": "multipart/form-data",
|
|
|
|
|
};
|
|
|
|
|
return httpPostInterceptor(url, data, { headers });
|
2025-01-03 21:18:22 +00:00
|
|
|
}
|
2025-01-05 21:03:58 +00:00
|
|
|
|
|
|
|
|
export async function getPrivacy(id: string) {
|
|
|
|
|
const url = `general/privacy-policy/${id}`;
|
|
|
|
|
return httpGetInterceptor(url);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function savePrivacy(data: any) {
|
|
|
|
|
const url = "general/privacy-policy/save";
|
|
|
|
|
return httpPostInterceptor(url, data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function listBanner() {
|
|
|
|
|
const url = "media/banner";
|
|
|
|
|
return httpGetInterceptor(url);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function listStaticBanner() {
|
|
|
|
|
const url = "media/static-banner";
|
|
|
|
|
return httpGetInterceptor(url);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function setStaticBanner(id: number) {
|
|
|
|
|
const url = `media/static-banner?id=${id}`;
|
|
|
|
|
return httpPostInterceptor(url);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function setBanner(id: number, status: boolean) {
|
|
|
|
|
const url = `media/banner?id=${id}&status=${status}`;
|
|
|
|
|
return httpPostInterceptor(url);
|
|
|
|
|
}
|