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:
parent
87bb3052a8
commit
d20bdfd9c1
@ -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);
|
||||
}
|
||||
|
@ -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']
|
||||
};
|
||||
|
@ -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']
|
||||
};
|
||||
|
||||
|
@ -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']
|
||||
|
@ -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']
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user