2025-01-03 21:18:22 +00:00
|
|
|
import {
|
|
|
|
|
httpDeleteInterceptor,
|
|
|
|
|
httpGetInterceptor,
|
|
|
|
|
httpPostInterceptor,
|
|
|
|
|
} from "../http-config/http-interceptor-service";
|
|
|
|
|
|
2025-05-23 02:28:18 +00:00
|
|
|
export async function getCategories(page: number, region: any) {
|
|
|
|
|
const url = `media/categories/list?enablePage=1&page=${page}&size=10&sort=desc&sortBy=id&publishedLocation=${region}`;
|
2025-01-03 21:18:22 +00:00
|
|
|
return httpGetInterceptor(url);
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-09 12:28:37 +00:00
|
|
|
export async function getCategoriesAll() {
|
|
|
|
|
const url = "media/categories/list?enablePage=0&size=100&sort=desc&sortBy=id";
|
|
|
|
|
return httpGetInterceptor(url);
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-03 21:18:22 +00:00
|
|
|
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",
|
|
|
|
|
};
|
2025-01-13 05:37:53 +00:00
|
|
|
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);
|
|
|
|
|
}
|
2025-01-09 12:28:37 +00:00
|
|
|
|
|
|
|
|
export async function getListFAQ() {
|
|
|
|
|
const url = "master/faq/list";
|
|
|
|
|
return httpGetInterceptor(url);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function postDataFAQ(data: any) {
|
|
|
|
|
const url = "master/faq";
|
|
|
|
|
return httpPostInterceptor(url, data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function deleteDataFAQ(id: string) {
|
|
|
|
|
const url = `master/faq/${id}`;
|
|
|
|
|
return httpDeleteInterceptor(url);
|
|
|
|
|
}
|
|
|
|
|
export async function detailDataFAQ(id: string) {
|
|
|
|
|
const url = `master/faq/${id}`;
|
|
|
|
|
return httpGetInterceptor(url);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function getListFeedback() {
|
|
|
|
|
const url = "master/feedback/list";
|
|
|
|
|
return httpGetInterceptor(url);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// export async function getUserFeedbacks() {
|
|
|
|
|
// const url = 'feedback/list-all';
|
|
|
|
|
// return httpGetInterceptor({ url });
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
export async function detailDataFeedback(id: string) {
|
|
|
|
|
const url = `master/feedback/${id}`;
|
|
|
|
|
return httpGetInterceptor(url);
|
|
|
|
|
}
|
|
|
|
|
export async function postDataFeedback(data: any) {
|
|
|
|
|
const url = "master/feedback";
|
|
|
|
|
return httpPostInterceptor(url, data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function deleteDataFeedback(id: string | number) {
|
|
|
|
|
const url = `master/feedback/${id}`;
|
|
|
|
|
return httpDeleteInterceptor(url);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function getTags() {
|
|
|
|
|
const url = "media/tags/list";
|
|
|
|
|
return httpGetInterceptor(url);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function getTagsBySubCategoryId(subCategory: string | number) {
|
|
|
|
|
const url = `media/tags/list?subCategoryId=${subCategory}`;
|
|
|
|
|
return httpGetInterceptor(url);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function getTagsByParentId(parentId: string | number) {
|
|
|
|
|
const url = `media/tags/list?categoryId=${parentId}`;
|
|
|
|
|
return httpGetInterceptor(url);
|
|
|
|
|
}
|
2025-06-04 17:06:44 +00:00
|
|
|
|
|
|
|
|
export async function postAdvertisements(data: any) {
|
|
|
|
|
const url = "advertisements";
|
2025-06-06 20:18:18 +00:00
|
|
|
const headers = {
|
|
|
|
|
"Content-Type": "multipart/form-data",
|
|
|
|
|
};
|
|
|
|
|
return httpPostInterceptor(url, data, headers);
|
2025-06-04 17:06:44 +00:00
|
|
|
}
|
2025-06-08 11:06:17 +00:00
|
|
|
|
|
|
|
|
export async function detailAdvertisements(id: any) {
|
|
|
|
|
const url = `advertisements?id=${id}`;
|
|
|
|
|
return httpGetInterceptor(url);
|
|
|
|
|
}
|
2025-06-08 14:54:54 +00:00
|
|
|
|
|
|
|
|
export async function deleteAdvertisements(id: string | number) {
|
|
|
|
|
const url = `advertisements?id=${id}`;
|
|
|
|
|
return httpDeleteInterceptor(url);
|
|
|
|
|
}
|
2025-06-14 01:15:59 +00:00
|
|
|
|
|
|
|
|
export async function setPopUp(id: number, status: boolean) {
|
|
|
|
|
const url = `media/interstitial?id=${id}&status=${status}`;
|
|
|
|
|
return httpPostInterceptor(url);
|
|
|
|
|
}
|