From e02643f32e4c97ca307f8fc5b69be79c40d70a3b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 22 May 2017 20:58:25 +0200 Subject: Type models --- server/middlewares/pagination.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/middlewares/pagination.ts') diff --git a/server/middlewares/pagination.ts b/server/middlewares/pagination.ts index 8fe9f9082..cadd76980 100644 --- a/server/middlewares/pagination.ts +++ b/server/middlewares/pagination.ts @@ -1,10 +1,10 @@ -const constants = require('../initializers/constants') +import { PAGINATION_COUNT_DEFAULT } from '../initializers' function setPagination (req, res, next) { if (!req.query.start) req.query.start = 0 else req.query.start = parseInt(req.query.start, 10) - if (!req.query.count) req.query.count = constants.PAGINATION_COUNT_DEFAULT + if (!req.query.count) req.query.count = PAGINATION_COUNT_DEFAULT else req.query.count = parseInt(req.query.count, 10) return next() -- cgit v1.2.3