feat: make sure correct data is sent to tracking
This commit is contained in:
committed by
Simon.Emanuelsson
parent
1a28bcdc4c
commit
e082bf2e50
@@ -1,6 +1,7 @@
|
||||
import { trackEvent } from "./base"
|
||||
|
||||
import type { SelectedAncillary } from "@/types/components/myPages/myStay/ancillaries"
|
||||
import { CurrencyEnum } from "@/types/enums/currency"
|
||||
import type { PackageSchema } from "@/types/trpc/routers/booking/confirmation"
|
||||
import type { CreditCard } from "@/types/user"
|
||||
|
||||
@@ -167,14 +168,15 @@ export function trackRemoveAncillary(
|
||||
hotelId: string,
|
||||
deliveryTime?: string
|
||||
) {
|
||||
const isPoints = ancillary.currency === CurrencyEnum.POINTS
|
||||
trackEvent({
|
||||
event: "removeAncillary",
|
||||
ancillaries: [
|
||||
{
|
||||
hotelId,
|
||||
productId: ancillary.code,
|
||||
productPrice: ancillary.totalPrice,
|
||||
productPoints: ancillary.points,
|
||||
productPrice: isPoints ? 0 : ancillary.totalPrice,
|
||||
productPoints: isPoints ? ancillary.totalPrice : 0,
|
||||
productUnits: ancillary.totalUnit,
|
||||
productType: ancillary.type,
|
||||
productDeliveryTime: deliveryTime,
|
||||
|
||||
Reference in New Issue
Block a user