Fix bug in querystring-helper

Used the wrong value in nested loops
This commit is contained in:
scottkiener-at-safelite 2026-03-31 13:50:35 -04:00
parent 0be681f88d
commit 8f4331107d

View file

@ -52,14 +52,14 @@ export function buildURLSearchParams(data) {
}
if (Array.isArray(value)) {
value.forEach((arrayValue, index) => {
if (typeof value === 'object') {
if (typeof arrayValue === 'object') {
Object.entries(arrayValue).forEach(([objectKey, objectValue]) => {
if (objectValue != null) {
params.append(`${key}[${index}].${objectKey}`, `${objectValue}`);
}
});
} else {
params.append(`${key}[${index}]`, `${value}`);
params.append(`${key}[${index}]`, `${arrayValue}`);
}
});
} else {