author | ymh <ymh.work@gmail.com> |
Wed, 21 Dec 2016 15:23:00 +0100 | |
changeset 483 | b47da9606c10 |
parent 474 | 245b4df137d3 |
permissions | -rw-r--r-- |
import DS from 'ember-data'; export default DS.JSONSerializer.extend({ normalizeResponse: function(store, primaryModelClass, payload) { var data = []; var themes = payload['themes']; Object.keys(themes).forEach(function(key) { data.push({ 'id': key, 'type': 'theme', 'attributes': { 'label': themes[key].label, 'count': themes[key].count } }); }); return { 'data': data, 'meta': payload['meta'] }; } });