Skip to content

Commit 88cbcb5

Browse files
authored
Remove product details mapping
Unnecessary now that unknown keys are accepted
1 parent 2e82157 commit 88cbcb5

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/requestBuilder.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { ComponentSettings, MCEvent } from '@managed-components/types'
22
import {
33
buildProductRequest,
44
EVENTS,
5-
mapProductToItem,
65
PREFIX_PARAMS_MAPPING,
76
} from './ecommerce'
87
import { flattenKeys, isNumber } from './utils'
@@ -169,14 +168,12 @@ const getFinalURL = (
169168
if (ecommerceData.products) {
170169
// handle products list
171170
for (const [index, product] of (ecommerceData.products || []).entries()) {
172-
const item = mapProductToItem(product)
173-
prQueryParams = buildProductRequest(item)
171+
prQueryParams = buildProductRequest(product)
174172
toolRequest[`pr${index + 1}`] = prQueryParams
175173
}
176174
} else {
177175
// handle single product data
178-
const item = mapProductToItem(ecommerceData)
179-
prQueryParams = buildProductRequest(item)
176+
prQueryParams = buildProductRequest(ecommerceData)
180177
if (prQueryParams) toolRequest['pr1'] = prQueryParams
181178
}
182179
}

0 commit comments

Comments
 (0)