Skip to content

Commit

Permalink
Simplify buildProductListingRequestV2 function
Browse files Browse the repository at this point in the history
  • Loading branch information
fbeaudoincoveo committed Aug 24, 2023
1 parent c5c708e commit a9f22ef
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,22 +136,14 @@ export const buildProductListingRequestV2 = async (
): Promise<ProductListingV2Request> => {
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 && {
Expand Down

0 comments on commit a9f22ef

Please sign in to comment.