author | ymh <ymh.work@gmail.com> |
Sun, 27 Nov 2016 15:12:30 +0100 | |
changeset 447 | 38d5789e30d0 |
parent 319 | 78990a8a069b |
child 532 | 1190ea937f2d |
permissions | -rw-r--r-- |
import { JSONAPISerializer } from 'ember-cli-mirage'; import _ from 'lodash/lodash'; export default JSONAPISerializer.extend({ serialize(response, request) { var map = response.models.find(map => map.id === request.queryParams['area']); return {'geostats': _(map && map.areas || {}).map((geostat) => { return [geostat.id, geostat.count];}).object().value()}; } });