author | Chloe Laisne <chloe.laisne@gmail.com> |
Sat, 15 Oct 2016 16:15:07 +0530 | |
changeset 336 | f076ddd29e13 |
parent 179 | 9b703ece424f |
child 319 | 78990a8a069b |
permissions | -rw-r--r-- |
import DS from 'ember-data'; export default DS.JSONSerializer.extend({ normalizeResponse: function(store, primaryModelClass, payload) { var data = []; Object.keys(payload).forEach(function(key) { data.push({ 'id': key, 'type': 'theme', 'attributes': { 'label': payload[key].label, 'count': payload[key].count } }); }); return { 'data': data }; } });