
One thing that is not standard here is a serializer for branch, which uses @href as id. At this point branches don't have ids and ember-data needs one, so using @href is the easiest way.
13 lines
332 B
JavaScript
13 lines
332 B
JavaScript
import Ember from 'ember';
|
|
import V3Serializer from 'travis/serializers/v3';
|
|
|
|
export default V3Serializer.extend({
|
|
extractAttributes(klass, payload) {
|
|
payload.id = payload['@href'];
|
|
return this._super(...arguments);
|
|
},
|
|
extractId(modelClass, resourceHash) {
|
|
return resourceHash.id || resourceHash['@href'];
|
|
}
|
|
});
|