Closed eatsleepdeploy closed 3 years ago
When attempting to retrieve a batch of customers whose IDs are in a batch of ids the filtering fails.
Example:
const results: ListResult = await chargebee.customer .list({ id: { in: ["id1", "id2"] }, }) .request(undefined)
Adding some logging to the lib shows that this gives the below encoding:
id[in][0]=id1&id[in][1]=id2&limit=10
The result is that the filter seems to be ignored and I get paginated response containing every single customer.
const results: ListResult = await chargebee.customer .list({ // @ts-ignore id: { in: JSON.stringify(["id1", "id2"]) }, }) .request(undefined)
Which gives the below encoding for the url:
id[in]=["id1","id2"]&limit=10
This seems to return only the customers whose IDs match.
in
stringify
I tried the node lib too (chargebee on npm) and hit the same issue so assume that the fix will need to be applied to that lib also.
chargebee
Huh, never mind I guess, I updated the lib to latest version and it now works. My bad.
Problem:
When attempting to retrieve a batch of customers whose IDs are in a batch of ids the filtering fails.
Example:
Adding some logging to the lib shows that this gives the below encoding:
The result is that the filter seems to be ignored and I get paginated response containing every single customer.
Workaround:
Which gives the below encoding for the url:
This seems to return only the customers whose IDs match.
Solution Ideas:
in
type to a string and update docs to indicate that we shouldstringify
the listNote:
I tried the node lib too (
chargebee
on npm) and hit the same issue so assume that the fix will need to be applied to that lib also.