2025-07-02 15:44:00 +00:00
|
|
|
import { PaginationRequest } from "@/types/globals";
|
2025-07-03 17:18:54 +00:00
|
|
|
import { httpGetInterceptor, httpPostInterceptor, httpPutInterceptor } from "./http-config/http-interceptor-services";
|
|
|
|
|
import { httpGet } from "./http-config/http-base-services";
|
2025-07-02 15:44:00 +00:00
|
|
|
|
|
|
|
|
export async function createCustomStaticPage(data: any) {
|
|
|
|
|
const pathUrl = `/custom-static-pages`;
|
2025-07-03 17:18:54 +00:00
|
|
|
return await httpPostInterceptor(pathUrl, data);
|
2025-07-02 15:44:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function editCustomStaticPage(data: any) {
|
|
|
|
|
const pathUrl = `/custom-static-pages/${data.id}`;
|
2025-07-03 17:18:54 +00:00
|
|
|
return await httpPutInterceptor(pathUrl, data);
|
2025-07-02 15:44:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function getCustomStaticPage(props: PaginationRequest) {
|
|
|
|
|
const { page, limit, search } = props;
|
2025-07-03 17:18:54 +00:00
|
|
|
const pathUrl = `/custom-static-pages?limit=${limit}&page=${page}&title=${search}`;
|
|
|
|
|
return await httpGetInterceptor(pathUrl);
|
2025-07-02 15:44:00 +00:00
|
|
|
}
|
2025-07-03 17:18:54 +00:00
|
|
|
|
2025-07-02 15:44:00 +00:00
|
|
|
export async function getCustomStaticDetail(id: string) {
|
2025-07-03 17:18:54 +00:00
|
|
|
return await httpGetInterceptor(`/custom-static-pages/${id}`);
|
2025-07-02 15:44:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function getCustomStaticDetailBySlug(slug: string) {
|
2025-07-03 17:18:54 +00:00
|
|
|
const pathUrl = `/custom-static-pages/slug/${slug}`;
|
|
|
|
|
return await httpGet(pathUrl);
|
2025-07-02 15:44:00 +00:00
|
|
|
}
|