Calls with filter params (JSONAPI)
See original GitHub issueI’m trying to stub a GET /supports?filter[proposal_id]=1&filter[author_id]=1
call, which uses JSONAPI filtering, with
this.get('/supports?filter[proposal_id]=1&filter[author_id]=1', function(db, request) {
...
});
but it doesn’t get recognized. this.get('/supports, function...
does, but that means that all GET calls to /supports
get intercepted as well.
Am I doing something wrong, or is this a limitation of the way uris are parsed? If so, are there any tricks to get around it?
Issue Analytics
- State:
- Created 8 years ago
- Comments:11
Top Results From Across the Web
Filtering
Resources can be filtered by attributes using the filter query string parameter. By default, all attributes are filterable. The filtering strategy we have ......
Read more >Calls with filter params (JSONAPI) · Issue #278 - GitHub
I'm trying to stub a GET /supports?filter[proposal_id]=1&filter[author_id]=1 call, which uses JSONAPI filtering, ...
Read more >Filtering | JSON:API module | Drupal Wiki guide on Drupal.org
This guide will teach you how to build filters like a pro. Quick Start. The simplest, most common filter is a key-value filter:...
Read more >Share/Propose a Filtering Strategy - JSON API
The filter query parameter can be used as the basis for any number of filtering strategies.”. http://jsonapi.org/format/#fetching-filtering.
Read more >JSON:API — Recommendations
Filtering. The base specification is agnostic about filtering strategies supported by a server. The filter query parameter family is reserved to be used...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Example that supports filtering by an array of values. You can pass a function to
where
instead of a POJO (see https://github.com/samselikoff/ember-cli-mirage/blob/master/addon/db-collection.js#L399).Another option here would be to do
schema.trips.all().filter(...)
.Latest issue tracking this feature request is https://github.com/samselikoff/ember-cli-mirage/issues/1419