mirror of
https://github.com/TryGhost/Ghost-Admin.git
synced 2023-12-14 02:33:04 +01:00
Added temporary workaround on client for API sending email: {}
This commit is contained in:
parent
56204d0129
commit
798b941241
1 changed files with 15 additions and 0 deletions
|
@ -30,6 +30,21 @@ export default ApplicationSerializer.extend(EmbeddedRecordsMixin, {
|
|||
return this._super(...arguments);
|
||||
},
|
||||
|
||||
// TODO: do not keep - workaround for API returning `email: {}`
|
||||
normalize() {
|
||||
let json = this._super(...arguments);
|
||||
|
||||
if (json.data.relationships.email && !json.data.relationships.email.data.id) {
|
||||
delete json.data.relationships.email;
|
||||
|
||||
json.included = json.included.filter((include) => {
|
||||
return include.type !== 'email';
|
||||
});
|
||||
}
|
||||
|
||||
return json;
|
||||
},
|
||||
|
||||
serialize(/*snapshot, options*/) {
|
||||
let json = this._super(...arguments);
|
||||
|
||||
|
|
Loading…
Reference in a new issue