From a9f22efa16b10bf29f5f0d3089ab2ec8e093c746 Mon Sep 17 00:00:00 2001 From: fbeaudoincoveo Date: Thu, 24 Aug 2023 16:31:54 -0400 Subject: [PATCH] Simplify buildProductListingRequestV2 function --- .../product-listing/v2/product-listing-v2-actions.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/headless/src/features/product-listing/v2/product-listing-v2-actions.ts b/packages/headless/src/features/product-listing/v2/product-listing-v2-actions.ts index abbf29fa3b0..faea5137eff 100644 --- a/packages/headless/src/features/product-listing/v2/product-listing-v2-actions.ts +++ b/packages/headless/src/features/product-listing/v2/product-listing-v2-actions.ts @@ -136,22 +136,14 @@ export const buildProductListingRequestV2 = async ( ): Promise => { const selectedFacets = getFacets(state); - const baseParams = { + return { accessToken: state.configuration.accessToken, organizationId: state.configuration.organizationId, trackingId: state.productListing.trackingId, platformUrl: state.configuration.platformUrl, - }; - - const productListingParams = { locale: state.productListing.locale || 'en-us-usd', mode: state.productListing.mode, clientId: state.productListing.clientId || 'some-client-id', // Dummy value since the api requires one - }; - - return { - ...baseParams, - ...productListingParams, selectedFacets, context: state.productListing.context, ...(state.sort && {