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
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.