2018-03-19 12:53:17 +03:00
|
|
|
import BaseSerializer from './application';
|
|
|
|
|
|
|
|
export default BaseSerializer.extend({
|
|
|
|
embed: true,
|
|
|
|
|
|
|
|
include(request) {
|
2018-03-13 14:17:29 +03:00
|
|
|
let includes = [];
|
2018-03-19 12:53:17 +03:00
|
|
|
|
2018-03-13 14:17:29 +03:00
|
|
|
if (request.queryParams.include && request.queryParams.include.indexOf('tags') >= 0) {
|
|
|
|
includes.push('tags');
|
2018-03-19 12:53:17 +03:00
|
|
|
}
|
|
|
|
|
2018-03-13 14:17:29 +03:00
|
|
|
if (request.queryParams.include && request.queryParams.include.indexOf('authors') >= 0) {
|
|
|
|
includes.push('authors');
|
2018-03-19 12:53:17 +03:00
|
|
|
}
|
|
|
|
|
2018-03-13 14:17:29 +03:00
|
|
|
return includes;
|
2018-03-19 12:53:17 +03:00
|
|
|
}
|
|
|
|
});
|