Skip to content

Commit

Permalink
only append if value is truthy
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Rugh <[email protected]>
  • Loading branch information
sirugh committed Jan 14, 2025
1 parent ea7c6dd commit 9e30278
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/commerce.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export async function commerceEndpointWithQueryParams() {
const urlWithQueryParams = new URL(await getConfigValue('commerce-endpoint'));
await getQueryParams('cs').then((params) => {
Object.keys(params).forEach((key) => {
urlWithQueryParams.searchParams.append(key, params[key]);
if (params[key]) urlWithQueryParams.searchParams.append(key, params[key]);
});
});
return urlWithQueryParams;
Expand Down

0 comments on commit 9e30278

Please sign in to comment.