File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ updateSettings.schema = {
179
179
function * listNotifications ( query , userId ) {
180
180
const settings = yield getSettings ( userId ) ;
181
181
const notificationSettings = settings . notifications ;
182
- const limit = query . per_page ;
182
+ const limit = query . limit || query . per_page ;
183
183
const offset = ( query . page - 1 ) * limit ;
184
184
const filter = { where : {
185
185
userId,
@@ -213,7 +213,7 @@ function* listNotifications(query, userId) {
213
213
} ) ;
214
214
return {
215
215
items,
216
- perPage : query . per_page ,
216
+ perPage : limit ,
217
217
currentPage : query . page ,
218
218
total : docs . count ,
219
219
} ;
@@ -223,6 +223,8 @@ listNotifications.schema = {
223
223
query : Joi . object ( ) . keys ( {
224
224
page : Joi . number ( ) . integer ( ) . min ( 1 ) . default ( 1 ) ,
225
225
per_page : Joi . number ( ) . integer ( ) . min ( 1 ) . default ( DEFAULT_LIMIT ) ,
226
+ // supporting limit field temporarily
227
+ limit : Joi . number ( ) . integer ( ) . min ( 1 ) ,
226
228
type : Joi . string ( ) ,
227
229
platform : Joi . string ( ) ,
228
230
// when it is true, return only read notifications
You can’t perform that action at this time.
0 commit comments