author | Chloe Laisne <chloe.laisne@gmail.com> |
Mon, 17 Oct 2016 00:33:28 +0530 | |
changeset 343 | 3b2e76f5f3ca |
parent 319 | 78990a8a069b |
child 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 }; } });