mailbadger/app

Search by functionality for campaigns collection endpoint

Closed this issue · 0 comments

Is your feature request related to a problem? Please describe.
We need a way to filter out collections based on different criteria:

  • name
  • template_name

The search results should be returned as a filtered out collection, the response will remain the same.

Describe the solution you'd like

API Example:

/api/campaigns?name=Foo&template_name=bar

The query params names will be the same as the fields that we are searching on. The query condition should be done with a LIKE where the wildcard % to be placed on the end. Example:

SELECT * FROM campaigns WHERE `name` LIKE 'Foo%'...

If the user sends multiple search filters (name and template_name), then the query expression should include an AND operator, so the filter will be narrowed down further.