@@ -12,6 +12,7 @@ const { mongoose } = require('../db'),
12
12
bcrypt = require ( 'bcrypt' ) ,
13
13
crypto = require ( 'crypto' ) ,
14
14
{ min_length : password_min_length , salt_factor : password_salt_factor } = require ( 'config' ) . get ( 'openSenseMap-API-models.password' ) ,
15
+ { max_boxes : pagination_max_boxes } = require ( 'config' ) . get ( 'openSenseMap-API-models.pagination' ) ,
15
16
{ v4 : uuidv4 } = require ( 'uuid' ) ,
16
17
{ model : Box } = require ( '../box/box' ) ,
17
18
{ model : Claim } = require ( '../box/claim' ) ,
@@ -551,8 +552,8 @@ userSchema.methods.updateUser = function updateUser ({ email, language, name, cu
551
552
552
553
userSchema . methods . getBoxes = function getBoxes ( page ) {
553
554
return Box . find ( { _id : { $in : this . boxes } } )
554
- . limit ( 25 )
555
- . skip ( page * 25 )
555
+ . limit ( pagination_max_boxes )
556
+ . skip ( page * pagination_max_boxes )
556
557
. populate ( Box . BOX_SUB_PROPS_FOR_POPULATION )
557
558
. then ( function ( boxes ) {
558
559
return boxes . map ( b => b . toJSON ( { includeSecrets : true } ) ) ;
@@ -566,7 +567,7 @@ userSchema.methods.getBox = function getBox (boxId) {
566
567
user . checkBoxOwner ( boxId ) ;
567
568
568
569
return Box . findOne ( { _id : boxId } )
569
- . populate ( Box . BOX_SUB_PROPS_FOR_POPULATION )
570
+ // .populate(Box.BOX_SUB_PROPS_FOR_POPULATION)
570
571
. then ( function ( box ) {
571
572
return box . toJSON ( { includeSecrets : true } ) ;
572
573
} ) ;
0 commit comments