From 03a5a7fef9ec0cb9b91da4b18db93d3d7b5939b0 Mon Sep 17 00:00:00 2001 From: vradulescu-bd <140399829+vradulescu-bd@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:15:28 +0300 Subject: [PATCH] Revert "PID in metadata (#467)" This reverts commit 6da07043dfbabf749ac5170a29e36572dbc33e2d. --- solutions/scripts/utils/utils.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/solutions/scripts/utils/utils.js b/solutions/scripts/utils/utils.js index ca964eb0e..dc350c097 100644 --- a/solutions/scripts/utils/utils.js +++ b/solutions/scripts/utils/utils.js @@ -1,5 +1,3 @@ -import { getMetadata } from './aem.js'; - const cacheResponse = new Map(); const FETCH_URL = 'https://www.bitdefender.com.au/site/Store/ajax'; @@ -52,16 +50,11 @@ async function findProductVariant(cachedResponse, variant) { */ export async function fetchProduct(code = 'av', variant = '1u-1y', pid = null) { const data = new FormData(); - let pidFromUrl; - let pidFromMetadata; // extract pid from url if (!pid) { const url = new URL(window.location.href); - pidFromUrl = url.searchParams.get('pid'); - } - - if (!pidFromUrl) { - pidFromMetadata = getMetadata('pid'); + // eslint-disable-next-line no-param-reassign + pid = url.searchParams.get('pid'); } data.append('data', JSON.stringify({ @@ -69,7 +62,7 @@ export async function fetchProduct(code = 'av', variant = '1u-1y', pid = null) { product_id: code, config: { extra_params: { - pid: pidFromUrl || pidFromMetadata, + pid, }, }, }));