Ghost/ghost/admin/app/serializers/member.js
Kevin Ansfield 1ade40d697 Removed unneeded member.emailRecipients relationship setup
no issue

- the relationship is no longer used (it was a temporary solution whilst we built full member events) and was never fully set up resulting in warning output in test runs
- dropped remaining vestiges of the relationship
2022-05-25 11:18:37 +01:00

29 lines
873 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'},
lastSeenAtUTC: {key: 'last_seen_at'},
labels: {embedded: 'always'},
newsletters: {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.status;
delete json.last_seen_at;
// Normalize properties
json.name = json.name || '';
json.note = json.note || '';
return json;
}
}