equal
deleted
inserted
replaced
8 |
8 |
9 serialize(response, request) { |
9 serialize(response, request) { |
10 // This is how to call super, as Mirage borrows [Backbone's implementation of extend](http://backbonejs.org/#Model-extend) |
10 // This is how to call super, as Mirage borrows [Backbone's implementation of extend](http://backbonejs.org/#Model-extend) |
11 let json = BaseSerializer.prototype.serialize.apply(this, arguments); |
11 let json = BaseSerializer.prototype.serialize.apply(this, arguments); |
12 |
12 |
13 if(!!request.queryParams.id) { |
13 if(request.queryParams.id) { |
14 let docs = _(json['documents']).filter(function(m) { |
14 let docs = _(json['documents']).filter(function(m) { |
15 return m.id === request.queryParams.id; |
15 return m.id === request.queryParams.id; |
16 }).map(function(doc) { |
16 }).map(function(doc) { |
17 let res = _.omit(doc, ['publishers', 'mediaArray', 'transcript']); |
17 let res = _.omit(doc, ['publishers', 'mediaArray', 'transcript']); |
18 res['publisher'] = doc['publishers'].join(', '); |
18 res['publisher'] = doc['publishers'].join(', '); |