cms/app-client/mirage/serializers/discourse.js
author ymh <ymh.work@gmail.com>
Sat, 06 Aug 2016 21:29:33 +0700
changeset 261 02e2396bcbbc
parent 173 cf7b221238fd
child 319 78990a8a069b
permissions -rw-r--r--
Migrate to ember 2.7 + correct jquery null context error + declare shim for popcorn (instead of silencing the JSHint error)

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

import _ from 'lodash/lodash';

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