cms/app-client/mirage/serializers/discourse.js
author ymh <ymh.work@gmail.com>
Tue, 04 Oct 2016 13:53:56 +0200
changeset 320 0fce13da58af
parent 319 78990a8a069b
child 474 245b4df137d3
permissions -rw-r--r--
filter geostat by area + tests

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

import _ from 'lodash/lodash';

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