ng-admin
ng-admin copied to clipboard
remoteComplete wrap query in _filters
Hi, accourding to Docs With this config:
nga.field('post_id', 'reference')
.targetEntity(post)
.targetField(nga.field('title'))
.remoteComplete(true, {
refreshDelay: 300,
// populate choices from the response of GET /posts?q=XXX
searchQuery: function(search) { return { q: search }; }
})
.perPage(10) // limit the number of results to 10
It shoud request this url : /posts?q=XXX
but I don't know why it send this request: /posts?filters=%7B%22q%22:%22XXX%22%7D
which translate to: _filters={q:XXX}
Hi @samanmohamadi, take a look at https://ng-admin-book.marmelab.com/doc/API-mapping.html#filtering
All filter fields are added as a serialized object passed as the value of the _filters query parameter. But you can change this behaviour by using a FullRequestInterceptor.