mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-25 09:03:12 +03:00
16 lines
409 B
JavaScript
16 lines
409 B
JavaScript
|
import BaseSerializer from './application';
|
||
|
|
||
|
export default BaseSerializer.extend({
|
||
|
embed: true,
|
||
|
|
||
|
include(request) {
|
||
|
let queryIncludes = (request.queryParams.include || '').split(',').compact();
|
||
|
const includes = new Set(queryIncludes);
|
||
|
|
||
|
// embedded records that are included by default in the API
|
||
|
includes.add('labels');
|
||
|
|
||
|
return Array.from(includes);
|
||
|
}
|
||
|
});
|