import { PaginationRequest } from "@/types/globals"; import { httpDeleteInterceptor, httpGetInterceptor, httpPostInterceptor, httpPutInterceptor, } from "./http-config/http-interceptor-services"; import { httpGet } from "./http-config/http-base-services"; export async function getGaleryData(props: PaginationRequest) { const { page, limit, search } = props; return await httpGetInterceptor(`/galleries`); } export async function getGaleryFileData(props: PaginationRequest) { const { page, limit, search } = props; return await httpGetInterceptor(`/gallery-files`); } export async function getGaleryById(id: any) { const headers = { "content-type": "application/json", }; return await httpGet(`/galleries/${id}`, headers); } export async function getGaleryFileName(filename: any) { const headers = { "content-type": "application/json", }; return await httpGet(`/gallery-files/viewer/${filename}`, headers); } export async function createGalery(data: any) { const pathUrl = `/galleries`; return await httpPostInterceptor(pathUrl, data); } export async function updateGalery(id: any, data: any) { const headers = { "content-type": "multipart/form-data", }; return await httpPutInterceptor(`/galleries/${id}`, data, headers); } export async function updateUploadGaleryFile(id: any, data: any) { const headers = { "content-type": "multipart/form-data", }; return await httpPutInterceptor(`/gallery-files/${id}`, data, headers); } export async function uploadGaleryFile(id: any, data: any) { const headers = { "content-type": "multipart/form-data", }; return await httpPostInterceptor(`/gallery-files/`, data, headers); } export async function deleteGalery(id: string) { const headers = { "content-type": "application/json", }; return await httpDeleteInterceptor(`galleries/${id}`, headers); }