Ghost/ghost/admin/app/serializers/member.js
Rishabh f80b401555 Added status data to member model
refs https://github.com/TryGhost/Team/issues/943

- allows using member status values in the member list table when selected via filter
2021-08-10 17:43:36 +05:30

28 lines
801 B
JavaScript

/* eslint-disable camelcase */
import ApplicationSerializer from './application';
import {EmbeddedRecordsMixin} from '@ember-data/serializer/rest';
export default ApplicationSerializer.extend(EmbeddedRecordsMixin, {
attrs: {
createdAtUTC: {key: 'created_at'},
labels: {embedded: 'always'},
emailRecipients: {embedded: 'always'}
},
serialize(/*snapshot, options*/) {
let json = this._super(...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;
}
});