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 getPromotionPagination(props: PaginationRequest) { const { page, limit, search } = props; return await httpGetInterceptor(`/promotions`); } export async function getPromotionById(id: any) { const headers = { "content-type": "application/json", }; return await httpGet(`/promotions/${id}`, headers); } export async function createPromotion(data: any) { const headers = { "content-type": "multipart/form-data", }; return await httpPostInterceptor(`/promotions`, data, headers); } export async function updatePromotion(data: any, id: any) { const pathUrl = `/promotions/${id}`; return await httpPutInterceptor(pathUrl, data); } export async function deletePromotion(id: string) { const headers = { "content-type": "application/json", }; return await httpDeleteInterceptor(`promotions/${id}`, headers); } export async function approvePromotion(id: string | number) { const headers = { "content-type": "application/json", }; return await httpPutInterceptor(`/promotions/${id}/approve`, {}, headers); }