cms/app-client/mirage/serializers/datestat.js
author ymh <ymh.work@gmail.com>
Tue, 04 Oct 2016 11:58:39 +0200
changeset 319 78990a8a069b
parent 307 07b44a378ad8
child 532 1190ea937f2d
permissions -rw-r--r--
Work on front and back integration, correct the expected data format

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()};
    }
});