cms/app-client/mirage/serializers/language.js
author ymh <ymh.work@gmail.com>
Sun, 27 Nov 2016 16:31:37 +0100
changeset 448 4077a72f0fb6
parent 319 78990a8a069b
child 474 245b4df137d3
permissions -rw-r--r--
add minimum height for author and language
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) {
319
78990a8a069b Work on front and back integration, correct the expected data format
ymh <ymh.work@gmail.com>
parents: 274
diff changeset
     7
        return {'languages' : _(response.models).map((lang) => { return [lang.id, lang.count];}).object().value()};
173
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
});