ng-admin icon indicating copy to clipboard operation
ng-admin copied to clipboard

remoteComplete wrap query in _filters

Open samanmohamadi opened this issue 8 years ago • 1 comments

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}

samanmohamadi avatar Feb 21 '17 10:02 samanmohamadi

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.

baleato avatar Jul 12 '17 19:07 baleato