From 5b72a3fddda5766f2857e9e7eecf3c38ca4bd378 Mon Sep 17 00:00:00 2001 From: Josh Dassinger Date: Wed, 16 Oct 2024 13:37:04 -0500 Subject: [PATCH] SSR-1632 Don't pass null values --- src/helpers/querystring-helper.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/helpers/querystring-helper.js b/src/helpers/querystring-helper.js index 3572916c..11dcdb48 100644 --- a/src/helpers/querystring-helper.js +++ b/src/helpers/querystring-helper.js @@ -47,11 +47,16 @@ export function getTaxLineItemQueryString(lineItems, parameterName) { export function buildURLSearchParams(data) { const params = new URLSearchParams(); Object.entries(data).forEach(([key, value]) => { + if (value == null) { + return; + } if (Array.isArray(value)) { value.forEach((arrayValue, index) => { if (typeof value === 'object') { Object.entries(arrayValue).forEach(([objectKey, objectValue]) => { - params.append(`${key}[${index}].${objectKey}`, `${objectValue}`); + if (objectValue != null) { + params.append(`${key}[${index}].${objectKey}`, `${objectValue}`); + } }); } else { params.append(`${key}[${index}]`, `${value}`);