cms/app-client/mirage/serializers/discourse.js
author Chloe Laisne <chloe.laisne@gmail.com>
Fri, 05 Aug 2016 18:51:59 +0200
changeset 253 0be9770b09b4
parent 173 cf7b221238fd
child 319 78990a8a069b
permissions -rw-r--r--
Hide/show transcript button in the player - Do not request transscript when property is null in the document request
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
173
cf7b221238fd Work on test fixtures:
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
import { JSONAPISerializer } from 'ember-cli-mirage';
cf7b221238fd Work on test fixtures:
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
cf7b221238fd Work on test fixtures:
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
import _ from 'lodash/lodash';
cf7b221238fd Work on test fixtures:
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
cf7b221238fd Work on test fixtures:
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
export default JSONAPISerializer.extend({
cf7b221238fd Work on test fixtures:
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
    serialize(response) {
cf7b221238fd Work on test fixtures:
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
        return _(response.models).map((discourse) => { return [discourse.id, {count: discourse.count, label: discourse.label}];}).object().value();
cf7b221238fd Work on test fixtures:
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
    }
cf7b221238fd Work on test fixtures:
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
});