import { getCurrentMerchant } from '@tempi/auth'; import API from 'services/request'; export const smartPopupApi = { getSmartPopups: async (params) => { return API.smartActivationClient .get('/v1/smart-activation/popups', { params, }) .then((res) => res.data); }, upsertSmartPopup: async (params) => { return API.smartActivationClient.post( '/v1/smart-activation/popups', params, ); }, deletePopup: async (id: number) => { return API.smartActivationClient.delete( `/v1/smart-activation/popups/${id}`, ); }, getAllSegment: async () => { const currentMerchant = getCurrentMerchant(); const platformId = window?.config?.platformMapping?.[currentMerchant]; return API.userSegmentClient.get('/v1/segments', { params: { limit: 1000, page: 1, platformId }, }); }, };