cms/app-client/mirage/serializers/discourse.js
author ymh <ymh.work@gmail.com>
Mon, 28 Nov 2016 17:04:56 +0100
changeset 450 7bddb57bf806
parent 319 78990a8a069b
child 474 245b4df137d3
permissions -rw-r--r--
avoid use unsupported Reflect api

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