Permitted mongoTransformer option for read methods

refs #10922

This will allow us to pass through a customer transformer to replace
references to removed columns in the mongo query generated inside of NQL
This commit is contained in:
Fabien O'Carroll 2019-07-31 12:11:33 +08:00
parent 51fb0815b4
commit a89376bf26

View File

@ -686,11 +686,11 @@ ghostBookshelf.Model = ghostBookshelf.Model.extend({
case 'edit':
return baseOptions.concat(extraOptions, ['id', 'require']);
case 'findOne':
return baseOptions.concat(extraOptions, ['columns', 'require']);
return baseOptions.concat(extraOptions, ['columns', 'require', 'mongoTransformer']);
case 'findAll':
return baseOptions.concat(extraOptions, ['columns']);
return baseOptions.concat(extraOptions, ['columns', 'mongoTransformer']);
case 'findPage':
return baseOptions.concat(extraOptions, ['filter', 'order', 'page', 'limit', 'columns']);
return baseOptions.concat(extraOptions, ['filter', 'order', 'page', 'limit', 'columns', 'mongoTransformer']);
default:
return baseOptions.concat(extraOptions);
}