author | ymh <ymh.work@gmail.com> |
Fri, 16 Dec 2016 17:43:07 +0100 | |
changeset 474 | 245b4df137d3 |
parent 319 | 78990a8a069b |
child 532 | 1190ea937f2d |
permissions | -rw-r--r-- |
284 | 1 |
import { JSONAPISerializer } from 'ember-cli-mirage'; |
2 |
||
3 |
import _ from 'lodash/lodash'; |
|
4 |
||
5 |
export default JSONAPISerializer.extend({ |
|
6 |
serialize(response, request) { |
|
7 |
var map = response.models.find(map => map.id === request.queryParams['area']); |
|
319
78990a8a069b
Work on front and back integration, correct the expected data format
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
8 |
return {'geostats': _(map && map.areas || {}).map((geostat) => { return [geostat.id, geostat.count];}).object().value()}; |
284 | 9 |
} |
10 |
}); |