framework/ember/app/adapters/application.js
Toby Zerner abc794c966 Change the way we fetch multiple posts by ID
JSON-API specifies that multiple resources should be fetched with a
comma-separated list of IDs, i.e. discussions/1,2,3,4. But this is
problematic because if we do a findQuery with only one ID, then a
single object will come back from the API where the serializer is
expecting an array containing a single object.

Instead, I’ve just implemented an ids “filter” on the discussions index
API route (which is the default way that the adapter finds multiple
IDs.)
2015-01-16 17:26:17 +10:30

8 lines
190 B
JavaScript

import JsonApiAdapter from 'ember-json-api/json-api-adapter';
export default JsonApiAdapter.extend({
// Todo: make this loaded via an environment variable or something
host: '/api'
});