adminjs
adminjs copied to clipboard
Allow api.searchRecords to work off any property
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
} : {};
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.