author | ymh <ymh.work@gmail.com> |
Mon, 12 Jun 2017 14:53:59 +0200 | |
changeset 537 | d2e6ee099125 |
parent 532 | 1190ea937f2d |
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 |
}); |