
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.
25 lines
588 B
JavaScript
25 lines
588 B
JavaScript
import V3Adapter from 'travis/adapters/v3';
|
|
|
|
export default V3Adapter.extend({
|
|
buildUrl(modelName, id, snapshot, requestType, query) {
|
|
var url = this._super(...arguments);
|
|
|
|
return url;
|
|
},
|
|
|
|
ajaxOptions(url, type, options) {
|
|
var hash = options || {};
|
|
if(!hash.data) {
|
|
hash.data = {};
|
|
}
|
|
|
|
if(hash.data.include) {
|
|
hash.data.include += ',repository.default_branch,branch.last_build,build.commit';
|
|
} else {
|
|
hash.data.include = 'repository.default_branch,branch.last_build,build.commit';
|
|
}
|
|
|
|
return this._super(url, type, hash);
|
|
}
|
|
});
|