e-Spirit/javascript-content-api-library

Filter for boolean values not possible

Closed this issue · 2 comments

tk127 commented

When fetching datasource elements with fetchByFilter you can filter for values of the datasource elements. Currently this is possible for string, number and RegExp, but not for booleans:

Type 'boolean' is not assignable to type 'ComparisonFilterValue | ComparisonFilterValue[]'

I think this is just a small issue, as type 'boolean' could be added here:

https://github.com/e-Spirit/fsxa-api/blob/88e6c45492a2e7e9774c19a72742e8a3bc48a806/src/types.ts#L586

Hello @tk127
Thank you for sharing this issue with us.
Since filtering of results is a basic feature of the fsxa-api, we created an internal jira ticket for this issue.
A valid workaround could be to use the api with "additional params" (see https://github.com/e-Spirit/fsxa-api/blob/master/src/modules/FSXARemoteApi.ts#L141)
By doing this, it is possible to add query parameters to the CaaS request, which the fsxa-api does not (yet) support natively.

Updates regarding this ticket will synced with your issue.
Sorry for the long response time.

Internal Ticket id: TNG-1123

released to version:
fsxa-api@10.5.0
fsxa-pattern-library@8.7.0
fsxa-nuxt-module@7.5.0
fsxa-pwa@3.8.0