How can I properly pass a string array as a parameter for a GET call?
// Passing one value
param: filters=Something
value: filters: 'Something'
// Passing multiple values
param: filters=Something&filters=Something else
value: filters: [ 'Something', 'Something else' ]
The issue arises when passing only one value in the param, as it is interpreted as a string instead of an array. On the other hand, passing more than one value results in the expected string array.
I have attempted using Array.from, but it only creates an array from the string:
['S', 'o', 'm', 'e', 't', 'h', 'i', 'n', 'g']
Is there a way to ensure that single values are recognized and processed as a String array?
Edit:
I understand the query but require filter values to accurately filter the results and return them. When there is a lone value in the filter parameter, it treats it as a string rather than an array. How can I retain a single array with a single string value in this scenario?