cms/app-client/mirage/serializers/datestat.js
author ymh <ymh.work@gmail.com>
Thu, 20 Oct 2016 15:09:31 +0200
changeset 376 02f113d43f18
parent 319 78990a8a069b
child 532 1190ea937f2d
permissions -rw-r--r--
add date filter to documents api end point

import { JSONAPISerializer } from 'ember-cli-mirage';

import _ from 'lodash/lodash';

export default JSONAPISerializer.extend({
    serialize(response) {
        return {'datestats': _(response.models).map((dateinfo) => { return [dateinfo.id, dateinfo.count];}).object().value()};
    }
});