equal
deleted
inserted
replaced
|
1 import JSONAPISerializer from 'ember-data/serializers/json-api'; |
|
2 |
|
3 export default JSONAPISerializer.extend({ |
|
4 |
|
5 normalizeResponse: function(store, primaryModelClass, payload, id, requestType) { |
|
6 var annotations = []; |
|
7 payload.annotations.forEach(function(annotation) { |
|
8 annotations.push({ |
|
9 'content': annotation.content.data.content, |
|
10 'translation': annotation.content.data.transl['@value'], |
|
11 'start': annotation.begin, |
|
12 'end': annotation.end |
|
13 }); |
|
14 }); |
|
15 return { |
|
16 'data': { |
|
17 'id': id, |
|
18 'type': 'transcript', |
|
19 'attributes': { |
|
20 'title': payload.meta['dc:title']['@value'], |
|
21 'annotations': annotations |
|
22 } |
|
23 } |
|
24 }; |
|
25 } |
|
26 |
|
27 }); |