diff --git a/src/services/e-commerce/e-commerce.service.ts b/src/services/e-commerce/e-commerce.service.ts index 929ef19..26a46b6 100644 --- a/src/services/e-commerce/e-commerce.service.ts +++ b/src/services/e-commerce/e-commerce.service.ts @@ -1,20 +1,14 @@ -import { TRACK_EVENT } from '../../constants/track-event.constant'; -import { PaqService } from '../paqService/paq.service'; +import { TRACK_EVENT } from '../../constants/track-event.constant' +import { PaqService } from '../paqService/paq.service' import { Product } from '../../interfaces/product' import { PaymentInformation } from '../../interfaces/payment' export function addEcommerceItem(products: Product[]) { - PaqService.push([ - TRACK_EVENT.ADD_ECOMMERCE_ITEM, - products, - ]) + PaqService.push([TRACK_EVENT.ADD_ECOMMERCE_ITEM, products]) } -export function removeEcommerceItem(products: Product) { - PaqService.push([ - TRACK_EVENT.REMOVE_ECOMMERCE_ITEM, - products - ]) +export function removeEcommerceItem(products: Product[]) { + PaqService.push([TRACK_EVENT.REMOVE_ECOMMERCE_ITEM, products]) } export function getEcommerceItems(): Promise { @@ -22,36 +16,31 @@ export function getEcommerceItems(): Promise { try { PaqService.push([ function (this: any): void { - resolve(this.getEcommerceItems()); - }, - ]); + resolve(this.getEcommerceItems()) + } + ]) } catch (e) { if (e instanceof ReferenceError) { - reject(e); + reject(e) } } - }); + }) } -export function ecommerceOrder(products: Product[], paymentInformation: PaymentInformation) { - PaqService.push([ - TRACK_EVENT.ORDER_ECOMMERCE, - products, - paymentInformation, - ]); +export function ecommerceOrder( + products: Product[], + paymentInformation: PaymentInformation +) { + PaqService.push([TRACK_EVENT.ORDER_ECOMMERCE, products, paymentInformation]) } -export function updateEcommerceCart(products: Product[], grandTotal: number | string) { - PaqService.push([ - TRACK_EVENT.UPDATE_ECOMMERCE_CART, - products, - grandTotal, - ]); +export function updateEcommerceCart( + products: Product[], + grandTotal: number | string +) { + PaqService.push([TRACK_EVENT.UPDATE_ECOMMERCE_CART, products, grandTotal]) } export function ecommerceProductDetailView(products: Product[]) { - PaqService.push([ - TRACK_EVENT.ECOMMERCE_PRODUCT_DETAIL_VIEW, - products, - ]); + PaqService.push([TRACK_EVENT.ECOMMERCE_PRODUCT_DETAIL_VIEW, products]) }