mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-04 04:10:33 +03:00
23 lines
477 B
JavaScript
23 lines
477 B
JavaScript
|
import BaseSerializer from './application';
|
||
|
import {underscore} from '@ember/string';
|
||
|
|
||
|
export default BaseSerializer.extend({
|
||
|
embed: true,
|
||
|
|
||
|
include(/*request*/) {
|
||
|
let includes = [];
|
||
|
|
||
|
includes.push('productBenefits');
|
||
|
|
||
|
return includes;
|
||
|
},
|
||
|
|
||
|
keyForEmbeddedRelationship(relationshipName) {
|
||
|
if (relationshipName === 'productBenefits') {
|
||
|
return 'benefits';
|
||
|
}
|
||
|
|
||
|
return underscore(relationshipName);
|
||
|
}
|
||
|
});
|