mediahub-fe/service/settings/settings.ts

61 lines
1.6 KiB
TypeScript
Raw Normal View History

import {
httpDeleteInterceptor,
httpGetInterceptor,
httpPostInterceptor,
} from "../http-config/http-interceptor-service";
export async function getCategories() {
const url = "media/categories/list?enablePage=1&size=50&sort=desc&sortBy=id";
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);
}
export async function postCategory(data: any) {
const url = "media/categories";
return httpPostInterceptor(url, data);
}
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);
}