From f240b1f2266bb84171ac9eb062d19a29046bb6d3 Mon Sep 17 00:00:00 2001 From: lita Date: Sat, 19 Dec 2020 12:48:37 +0100 Subject: [PATCH 1/2] #20 asyncHandler.ts fix --- src/helpers/asyncHandler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers/asyncHandler.ts b/src/helpers/asyncHandler.ts index 2843632..0367464 100644 --- a/src/helpers/asyncHandler.ts +++ b/src/helpers/asyncHandler.ts @@ -1,7 +1,7 @@ import { Request, Response, NextFunction } from 'express'; -type AsyncFunction = (req: Request, res: Response, next: NextFunction) => Promise; +type AsyncFunction = (req: T, res: Response, next: NextFunction) => Promise; -export default (execution: AsyncFunction) => (req: Request, res: Response, next: NextFunction) => { +export default (execution: AsyncFunction) => (req: Request, res: Response, next: NextFunction) => { execution(req, res, next).catch(next); }; From 49af087290b15a332cbd61f66f61833c01e7e7e7 Mon Sep 17 00:00:00 2001 From: lita Date: Mon, 21 Dec 2020 11:18:09 +0100 Subject: [PATCH 2/2] typo on static method call fix --- src/database/repository/KeystoreRepo.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/database/repository/KeystoreRepo.ts b/src/database/repository/KeystoreRepo.ts index 056b905..a9262e7 100755 --- a/src/database/repository/KeystoreRepo.ts +++ b/src/database/repository/KeystoreRepo.ts @@ -4,7 +4,7 @@ import User from '../model/User'; export default class KeystoreRepo { public static findforKey(client: User, key: string): Promise { - return KeystoreModel.findOne({ client: client, primaryKey: key, status: true }).exec(); + return KeystoreModel.find({ client: client, primaryKey: key, status: true }).exec(); } public static remove(id: Types.ObjectId): Promise {