2017-12-15 21:39:18 +00:00
|
|
|
import { inject as service } from '@ember/service';
|
2017-09-19 14:47:10 +00:00
|
|
|
import ApplicationSerializer from './application';
|
|
|
|
|
|
|
|
export default ApplicationSerializer.extend({
|
2017-12-15 21:39:18 +00:00
|
|
|
config: service(),
|
2017-10-17 01:39:32 +00:00
|
|
|
|
2017-09-19 14:47:10 +00:00
|
|
|
attrs: {
|
|
|
|
httpAddr: 'HTTPAddr',
|
|
|
|
},
|
|
|
|
|
2017-10-17 01:39:32 +00:00
|
|
|
normalize(modelClass, hash) {
|
|
|
|
return this._super(modelClass, hash);
|
|
|
|
},
|
|
|
|
|
2017-09-19 14:47:10 +00:00
|
|
|
extractRelationships(modelClass, hash) {
|
|
|
|
const { modelName } = modelClass;
|
|
|
|
const nodeURL = this.store
|
|
|
|
.adapterFor(modelName)
|
|
|
|
.buildURL(modelName, this.extractId(modelClass, hash), hash, 'findRecord');
|
|
|
|
|
|
|
|
return {
|
|
|
|
allocations: {
|
|
|
|
links: {
|
|
|
|
related: `${nodeURL}/allocations`,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
},
|
|
|
|
});
|