Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import config from 'travis/config/environment';
import Ember from 'ember';
import ActiveModelAdapter from 'active-model-adapter';
const { service } = Ember.inject;
export default ActiveModelAdapter.extend({
auth: service(),
features: service(),
host: config.apiEndpoint,
coalesceFindRequests: true,
// Before Ember Data 2.0 the default behaviour of running `findAll` was to get
// new records only when there're no records in the store. This will change
// to a different strategy in 2.0: when you run `findAll` it will not get any
// new data initially, but it will try loading new data in the background.
//
// I'm disabling the new behaviour for now.
shouldBackgroundReloadRecord() {
return false;
},
ajaxOptions() {
import require from 'require';
import DS from 'ember-data';
import JSONAPIFixtureBuilder from './jsonapi-fixture-builder';
import RESTFixtureBuilder from './rest-fixture-builder';
import JSONFixtureBuilder from './json-fixture-builder';
import DRFFixtureBuilder from './drf-fixture-builder';
import ActiveModelFixtureBuilder from './active-model-fixture-builder';
let ActiveModelSerializer, DjangoSerializer;
try {
let activeModel = require('active-model-adapter');
ActiveModelSerializer = activeModel.ActiveModelSerializer;
} catch (e) {
// do nothing
}
try {
let drf = require('ember-django-adapter/serializers/drf');
DjangoSerializer = drf && drf.default;
} catch (e) {
// do nothing
}
export default class {
constructor(store) {
this.store = store;
}
import ActiveModelAdapter from 'active-model-adapter';
export default ActiveModelAdapter.extend({
namespace: 'api'
});
import ActiveModelAdapter from 'active-model-adapter';
export default ActiveModelAdapter.extend({
namespace: 'api'
});
import ActiveModelAdapter from 'active-model-adapter';
export default ActiveModelAdapter.extend({
namespace: 'api'
});
import { ActiveModelAdapter } from 'active-model-adapter';
export default ActiveModelAdapter.extend({
host: 'http://staging.vestorly.com',
namespace: 'api/v3/reader/publishers/infinite-scroll'
});
import ActiveModelAdapter from 'active-model-adapter';
export default ActiveModelAdapter.extend({
host: 'http://localhost:3009'
});
import ActiveModelAdapter from 'active-model-adapter';
export default ActiveModelAdapter.extend({
namespace: 'api/v4',
coalesceFindRequests: true
});
import ActiveModelAdapter from 'active-model-adapter';
export default ActiveModelAdapter.extend({
host: 'https://api.github.com',
queryUrl: 'https://api.github.com/search',
buildURL(modelName, id, snapshot, requestType) {
if(requestType === 'query') {
this.host = this.queryUrl
}
return this._super(...arguments);
}
});