interface ProductTypes { id: number; currentPage: number; } export const endPoints = { category: { all: "category/", }, subCategory: { byId: (id: number) => `subCategory/?category=${id}`, }, services: { all: "firesafety/?page_size=500", detail: (id: number) => `firesafety/${id}`, }, product: { byCategory: ({ id, currentPage }: ProductTypes) => { let link = "product/?page_size=12"; if (id) link += `&category=${id}`; if (currentPage) link += `&page=${currentPage}`; return link; }, bySubCategory: ({ id, currentPage }: ProductTypes) => { let link = "product/"; if (id) link += `?subCategory=${id}`; if (currentPage) link += `&page=${currentPage}`; return link; }, detail: (id: number) => `product/${id}/`, }, faq: "faq/", gallery: "gallery/?page_size=500", contact: "contact/", statistics: "statistics/", banner: "banner/?page_size=500", navbar: "navigationitem/?page_size=500", sertificate: "document/?type=certificate", normative: "document/?type=normative", guides: "guide/", filter: { catalog: "catalogsection/?page_size=500", child: (parenId: number) => `catalogsection/?page_size=500&parent=${parenId}`, }, post: { sendNumber: "callBack/", productContact: "customer/", contact: "question/", }, };