changeset 176 | d1baf7ccecc8 |
child 179 | 9b703ece424f |
175:7a7cfcba5bfe | 176:d1baf7ccecc8 |
---|---|
1 import DS from 'ember-data'; |
|
2 |
|
3 export default DS.JSONSerializer.extend({ |
|
4 |
|
5 normalizeResponse: function(store, primaryModelClass, payload, id, requestType) { |
|
6 var data = []; |
|
7 Object.keys(payload).forEach(function(key) { |
|
8 data.push({ |
|
9 'id': key, |
|
10 'type': 'theme', |
|
11 'attributes': { |
|
12 'label': payload[key].label, |
|
13 'count': payload[key].count |
|
14 } |
|
15 }); |
|
16 }); |
|
17 return { |
|
18 'data': data |
|
19 }; |
|
20 } |
|
21 |
|
22 }); |