User adapter

coalesceFindRequests: false
This commit is contained in:
Matthew Dillon 2015-11-17 09:59:02 -07:00
parent 40ac4b30af
commit b19913aece
2 changed files with 7 additions and 0 deletions

View file

@ -0,0 +1,31 @@
import DS from 'ember-data';
import DataAdapterMixin from 'ember-simple-auth/mixins/data-adapter-mixin';
import Ember from 'ember';
const { inject: { service } } = Ember;
const { RESTAdapter } = DS;
export default RESTAdapter.extend(DataAdapterMixin, {
globals: service(),
authorizer: 'authorizer:application',
namespace: function() {
return 'api/' + this.get('globals.genus');
}.property(),
host: function() {
return this.get('globals.apiURL');
}.property(),
coalesceFindRequests: true,
shouldReloadAll: function() {
return true;
},
shouldBackgroundReloadRecord: function() {
return false;
}
});

7
app/adapters/user.js Normal file
View file

@ -0,0 +1,7 @@
import ApplicationAdapter from '../adapters/application';
export default ApplicationAdapter.extend({
// If coalesceFindRequests is on, and we 403 on any requests, ESA logs
// the current user out. Better to split the requests up at the adapter level.
coalesceFindRequests: false,
});