findMany (store, type, ids, snapshots) Promise
The store will call findMany
instead of multiple findRecord
requests to find multiple records at once if coalesceFindRequests is true.
app/adapters/application.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | import DS from 'ember-data' ; export default DS.Adapter.extend({ findMany(store, type, ids, snapshots) { return new Ember.RSVP.Promise( function (resolve, reject) { Ember.$.ajax({ type: 'GET' , url: `/${type.modelName}/`, dataType: 'json' , data: { filter: { id: ids.join( ',' ) } } }).then( function (data) { Ember.run( null , resolve, data); }, function (jqXHR) { jqXHR.then = null ; // tame jQuery's ill mannered promises Ember.run( null , reject, jqXHR); }); }); } }); |
Parameters:
Returns:
-
Promise
- promise
Please login to continue.