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}`);