fixed linting

This commit is contained in:
Ronald Langeveld 2022-07-06 10:26:42 +02:00 committed by Ronald Langeveld
parent 35ab123499
commit bb509ee02c
2 changed files with 5 additions and 3 deletions

View File

@ -82,6 +82,7 @@ module.exports = function (Bookshelf) {
const options = this.filterOptions(unfilteredOptions, 'findPage');
const itemCollection = this.getFilteredCollection(options);
const requestedColumns = options.columns;
requiredForExcerpt(requestedColumns);
// Set this to true or pass ?debug=true as an API option to get output
itemCollection.debug = unfilteredOptions.debug && process.env.NODE_ENV !== 'production';
@ -137,6 +138,10 @@ module.exports = function (Bookshelf) {
data = this.filterData(data);
const model = this.forge(data);
const requestedColumns = options.columns;
// make sure we include plaintext and custom_excerpt if excerpt is requested
requiredForExcerpt(requestedColumns);
// @NOTE: The API layer decides if this option is allowed
if (options.filter) {
model.applyDefaultAndCustomFilters(options);

View File

@ -52,6 +52,3 @@ describe('Unit: canary/utils/serializers/output/utils/extra-attrs', function ()
});
});
});