Fix tests

This commit is contained in:
Amir.Tugi@Gmail.com
2018-05-22 15:23:39 +03:00
parent bfdbdd2d6d
commit 571f1889da
2 changed files with 7 additions and 6 deletions
@@ -5,7 +5,7 @@ declare function findAndCountAll(params: object): Promise<{count: number, rows:
const app = express();
app.use(paginate.middleware(10, 50))
app.use(paginate.middleware(10, 50));
app.get('/users', async (req, res, next) => {
// req.skip should be available
@@ -22,5 +22,5 @@ app.get('/users', async (req, res, next) => {
hasNextPages: paginate.hasNextPages(req)(pageCount),
pages: paginate.getArrayPages(req)(3, pageCount, req.query.page)
});
}).catch(err => next(err))
}).catch(next);
});
+5 -4
View File
@@ -2,19 +2,20 @@
// Project: https://github.com/niftylettuce/express-paginate
// Definitions by: My Self <https://github.com/me>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.7
import * as express from 'express';
declare global {
namespace Express {
export interface Request {
skip?: number,
offset?: number,
interface Request {
skip?: number;
offset?: number;
}
}
}
interface PageElement {
export interface PageElement {
number: number;
url: typeof href;
}