Fix bug in querystring-helper
Used the wrong value in nested loops
This commit is contained in:
parent
0be681f88d
commit
8f4331107d
1 changed files with 2 additions and 2 deletions
|
|
@ -52,14 +52,14 @@ export function buildURLSearchParams(data) {
|
||||||
}
|
}
|
||||||
if (Array.isArray(value)) {
|
if (Array.isArray(value)) {
|
||||||
value.forEach((arrayValue, index) => {
|
value.forEach((arrayValue, index) => {
|
||||||
if (typeof value === 'object') {
|
if (typeof arrayValue === 'object') {
|
||||||
Object.entries(arrayValue).forEach(([objectKey, objectValue]) => {
|
Object.entries(arrayValue).forEach(([objectKey, objectValue]) => {
|
||||||
if (objectValue != null) {
|
if (objectValue != null) {
|
||||||
params.append(`${key}[${index}].${objectKey}`, `${objectValue}`);
|
params.append(`${key}[${index}].${objectKey}`, `${objectValue}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
params.append(`${key}[${index}]`, `${value}`);
|
params.append(`${key}[${index}]`, `${arrayValue}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue