kontent-ai / delivery-sdk-js

Kontent Delivery SDK for Javascript
https://kontent.ai
MIT License
50 stars 34 forks source link

One Function for all the filters #298

Closed prakharb147 closed 3 years ago

prakharb147 commented 3 years ago

Motivation

Why is this feature required? What problems does it solve? To be able to use one method for filtering content rather than using functions like, type, types, allFilter, anyFilter, containsFilter.

Proposed solution

One function with a param that understands and performs filtering using that param. E.g. client.getEntries(params) An ideal solution for the above problems.

Additional context

Add any other context, screenshots, or reference links about the feature request here.

Enngage commented 3 years ago

@prakharb147 You may use withParameters extension method for this purpose :-) (see https://github.com/Kentico/kontent-delivery-sdk-js/blob/vnext/lib/query/common/base-query.class.ts#L33 )

In it you pass array of parameters from Parameters interface.