Moved more allowed options for findPage to base model

no issue

- no need to define these options in each model
This commit is contained in:
kirrg001 2019-01-29 23:29:06 +01:00
parent 87bb3052a8
commit d20bdfd9c1
5 changed files with 3 additions and 5 deletions

View File

@ -515,7 +515,7 @@ ghostBookshelf.Model = ghostBookshelf.Model.extend({
case 'findAll':
return baseOptions.concat(extraOptions, ['columns']);
case 'findPage':
return baseOptions.concat(extraOptions, ['filter']);
return baseOptions.concat(extraOptions, ['filter', 'order', 'page', 'limit', 'columns']);
default:
return baseOptions.concat(extraOptions);
}

View File

@ -658,7 +658,7 @@ Post = ghostBookshelf.Model.extend({
// these are the only options that can be passed to Bookshelf / Knex.
validOptions = {
findOne: ['columns', 'importing', 'withRelated', 'require'],
findPage: ['page', 'limit', 'columns', 'order', 'status', 'staticPages'],
findPage: ['status', 'staticPages'],
findAll: ['columns', 'filter'],
destroy: ['destroyAll']
};

View File

@ -42,7 +42,6 @@ Subscriber = ghostBookshelf.Model.extend({
// whitelists for the `options` hash argument on methods, by method name.
// these are the only options that can be passed to Bookshelf / Knex.
validOptions = {
findPage: ['page', 'limit', 'columns', 'order'],
findAll: ['columns']
};

View File

@ -74,7 +74,6 @@ Tag = ghostBookshelf.Model.extend({
// whitelists for the `options` hash argument on methods, by method name.
// these are the only options that can be passed to Bookshelf / Knex.
validOptions = {
findPage: ['page', 'limit', 'columns', 'order'],
findAll: ['columns'],
findOne: ['visibility'],
destroy: ['destroyAll']

View File

@ -338,7 +338,7 @@ User = ghostBookshelf.Model.extend({
setup: ['id'],
edit: ['withRelated', 'importPersistUser'],
add: ['importPersistUser'],
findPage: ['page', 'limit', 'columns', 'order', 'status'],
findPage: ['status'],
findAll: ['filter']
};