Skip to content

Commit

Permalink
Fix query parameters for array values
Browse files Browse the repository at this point in the history
We were creating a new snakeCaseKey=item for each item in the value array.

This was creating multiple instances of the snakeCaseKey query param if there is more than one item in an array.
  • Loading branch information
wallacecs007 committed Nov 19, 2024
1 parent 1659161 commit a234a11
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/apiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ export default class APIClient {
}
url.searchParams.set('metadata_pair', metadataPair.join(','));
} else if (Array.isArray(value)) {
for (const item of value) {
url.searchParams.append(snakeCaseKey, item as string);
}
url.searchParams.append(snakeCaseKey, value.join(','));
} else if (typeof value === 'object') {
for (const item in value) {
url.searchParams.append(
Expand Down

0 comments on commit a234a11

Please sign in to comment.