adminjs icon indicating copy to clipboard operation
adminjs copied to clipboard

Allow api.searchRecords to work off any property

Open AshotN opened this issue 1 year ago • 1 comments

Describe the problem feature solves using api.searchRecords() only lets you search by the title of the resource.

Describe the solution you'd like Add a property to searchRecords that allows you to search by any field in a resource.

Describe alternatives you've considered I've made the field I was searching by the title, but it is not ideal.

Acceptance criteria [ ] - Allow a more robust search

This is the offending bit of code in search-action

 const titlePropertyName = decorated.titleProperty().name();
...
 const queryFilter = queryString ? {
      [titlePropertyName]: queryString
    } : {};

AshotN avatar Sep 02 '22 00:09 AshotN

This will be nice to have, however we'll have to plan it first, I'll let you know when it can be implemented once I know myself.

dziraf avatar Sep 13 '22 10:09 dziraf