import DS from 'ember-data';

export default DS.Serializer.extend({

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

});
