author | ymh <ymh.work@gmail.com> |
Sat, 10 Jun 2017 08:33:03 +0200 | |
changeset 532 | 1190ea937f2d |
parent 319 | 78990a8a069b |
permissions | -rw-r--r-- |
307 | 1 |
import { JSONAPISerializer } from 'ember-cli-mirage'; |
2 |
||
532
1190ea937f2d
make things work after node 8, npm 5 migration. Migrate to lodash 4
ymh <ymh.work@gmail.com>
parents:
319
diff
changeset
|
3 |
import _ from 'lodash'; |
307 | 4 |
|
5 |
export default JSONAPISerializer.extend({ |
|
6 |
serialize(response) { |
|
532
1190ea937f2d
make things work after node 8, npm 5 migration. Migrate to lodash 4
ymh <ymh.work@gmail.com>
parents:
319
diff
changeset
|
7 |
return {'datestats': _(response.models).map((dateinfo) => { return [dateinfo.id, dateinfo.count];}).fromPairs().value()}; |
307 | 8 |
} |
9 |
}); |