31 lines
831 B
TypeScript
31 lines
831 B
TypeScript
|
|
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);
|
||
|
|
}
|