import DS from 'ember-data';

export default DS.Serializer.extend({

    normalizeResponse: function(store, primaryModelClass, payload) {
        var data = [];
        Object.keys(payload['datestats']).forEach(function(key) {
            data.push({
                'id': key,
                'type': 'datestat',
                'attributes': {
                    'count': payload['datestats'][key]
                }
            });
        });
        return {
            'data': data
        };
    }

});
