Error
When running .filter() multiple times to build a query, multiplefilter [filters]; appear in the request data. The IDGB v3 API sends a 500 code, but also valid JSON resulting in Axios to throw an error.
Research
The code suggests to me the request data is invalid, but this repo's tests also suggest to me that it is valid because .filter() is called multiple times, but this might just be to make testing both arrays and strings easier.
If it is unsupported, calling .filter() and perhaps other similar methods like .fields() should add to previous calls.
Potential Solution
This could be resolved by having a dictionary this.filterDict instead of this.filterArray which each method checks against and then .constructOptions() uses to generate the request data.
I'm going to start working on code tonight that should work.
Error When running
.filter()
multiple times to build a query, multiplefilter [filters];
appear in the request data. The IDGB v3 API sends a 500 code, but also valid JSON resulting in Axios to throw an error.Research The code suggests to me the request data is invalid, but this repo's tests also suggest to me that it is valid because
.filter()
is called multiple times, but this might just be to make testing both arrays and strings easier.If it is unsupported, calling
.filter()
and perhaps other similar methods like.fields()
should add to previous calls.Potential Solution This could be resolved by having a dictionary
this.filterDict
instead ofthis.filterArray
which each method checks against and then.constructOptions()
uses to generate the request data.I'm going to start working on code tonight that should work.