cms/app-client/app/serializers/theme.js
changeset 339 766af1228b05
parent 319 78990a8a069b
child 474 245b4df137d3
equal deleted inserted replaced
338:4a3899b6a7ed 339:766af1228b05
     2 
     2 
     3 export default DS.JSONSerializer.extend({
     3 export default DS.JSONSerializer.extend({
     4 
     4 
     5     normalizeResponse: function(store, primaryModelClass, payload) {
     5     normalizeResponse: function(store, primaryModelClass, payload) {
     6         var data = [];
     6         var data = [];
     7         Object.keys(payload).forEach(function(key) {
     7         var themes = payload['themes'];
       
     8         Object.keys(themes).forEach(function(key) {
     8             data.push({
     9             data.push({
     9                 'id': key,
    10                 'id': key,
    10                 'type': 'theme',
    11                 'type': 'theme',
    11                 'attributes': {
    12                 'attributes': {
    12                     'label': payload[key].label,
    13                     'label': themes[key].label,
    13                     'count': payload[key].count
    14                     'count': themes[key].count
    14                 }
    15                 }
    15             });
    16             });
    16         });
    17         });
    17         return {
    18         return {
    18             'data': data
    19             'data': data