mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-19 16:42:17 +03:00
d51f2bcf23
closes https://github.com/TryGhost/Admin/pull/2107 - updated related babel dependencies - bumped eslint - ran `yarn lint:js --fix` - added eslint ignore comments for some required non-camel-case properties
28 lines
835 B
JavaScript
28 lines
835 B
JavaScript
/* eslint-disable camelcase */
|
|
import ApplicationSerializer from './application';
|
|
import {EmbeddedRecordsMixin} from '@ember-data/serializer/rest';
|
|
|
|
export default class MemberSerializer extends ApplicationSerializer.extend(EmbeddedRecordsMixin) {
|
|
attrs = {
|
|
createdAtUTC: {key: 'created_at'},
|
|
labels: {embedded: 'always'},
|
|
emailRecipients: {embedded: 'always'}
|
|
};
|
|
|
|
serialize(/*snapshot, options*/) {
|
|
let json = super.serialize(...arguments);
|
|
|
|
// Properties that exist on the model but we don't want sent in the payload
|
|
delete json.stripe;
|
|
delete json.geolocation;
|
|
delete json.email_recipients;
|
|
delete json.status;
|
|
|
|
// Normalize properties
|
|
json.name = json.name || '';
|
|
json.note = json.note || '';
|
|
|
|
return json;
|
|
}
|
|
}
|