48 lines
1.4 KiB
TypeScript
48 lines
1.4 KiB
TypeScript
import { PaginationRequest } from "@/types/globals";
|
|
import {
|
|
httpDeleteInterceptor,
|
|
httpGet,
|
|
httpPost,
|
|
httpPut,
|
|
} from "./http-config/axios-base-service";
|
|
import { httpGetInterceptor } from "./http-config/http-interceptor-services";
|
|
|
|
export async function createCustomStaticPage(data: any) {
|
|
const headers = {
|
|
"content-type": "application/json",
|
|
};
|
|
const pathUrl = `/custom-static-pages`;
|
|
return await httpPost(pathUrl, headers, data);
|
|
}
|
|
|
|
export async function editCustomStaticPage(data: any) {
|
|
const headers = {
|
|
"content-type": "application/json",
|
|
};
|
|
const pathUrl = `/custom-static-pages/${data.id}`;
|
|
return await httpPut(pathUrl, headers, data);
|
|
}
|
|
|
|
export async function getCustomStaticPage(props: PaginationRequest) {
|
|
const { page, limit, search, timeStamp } = props;
|
|
const headers = {
|
|
"content-type": "application/json",
|
|
};
|
|
return await httpGetInterceptor(
|
|
`/custom-static-pages?limit=${limit}&page=${page}&title=${search}&timeStamp=${timeStamp}`
|
|
);
|
|
}
|
|
export async function getCustomStaticDetail(id: string) {
|
|
const headers = {
|
|
"content-type": "application/json",
|
|
};
|
|
return await httpGet(`/custom-static-pages/${id}`, headers);
|
|
}
|
|
|
|
export async function getCustomStaticDetailBySlug(slug: string) {
|
|
const headers = {
|
|
"content-type": "application/json",
|
|
};
|
|
return await httpGet(`/custom-static-pages/slug/${slug}`, headers);
|
|
}
|