From 69818c9394366b954b6ba3bd697bd9d2b09f2a16 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Sat, 10 Jun 2017 22:15:25 +0200 Subject: Type functions --- server/middlewares/validators/remote/signature.ts | 5 ++++- server/middlewares/validators/remote/videos.ts | 9 ++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'server/middlewares/validators/remote') diff --git a/server/middlewares/validators/remote/signature.ts b/server/middlewares/validators/remote/signature.ts index 6e3ebe7db..eb5c196eb 100644 --- a/server/middlewares/validators/remote/signature.ts +++ b/server/middlewares/validators/remote/signature.ts @@ -1,7 +1,10 @@ +import 'express-validator' +import * as express from 'express' + import { logger } from '../../../helpers' import { checkErrors } from '../utils' -function signatureValidator (req, res, next) { +function signatureValidator (req: express.Request, res: express.Response, next: express.NextFunction) { req.checkBody('signature.host', 'Should have a signature host').isURL() req.checkBody('signature.signature', 'Should have a signature').notEmpty() diff --git a/server/middlewares/validators/remote/videos.ts b/server/middlewares/validators/remote/videos.ts index 3380c29e2..2037c0085 100644 --- a/server/middlewares/validators/remote/videos.ts +++ b/server/middlewares/validators/remote/videos.ts @@ -1,7 +1,10 @@ +import 'express-validator' +import * as express from 'express' + import { logger } from '../../../helpers' import { checkErrors } from '../utils' -function remoteVideosValidator (req, res, next) { +function remoteVideosValidator (req: express.Request, res: express.Response, next: express.NextFunction) { req.checkBody('data').isEachRemoteRequestVideosValid() logger.debug('Checking remoteVideos parameters', { parameters: req.body }) @@ -9,7 +12,7 @@ function remoteVideosValidator (req, res, next) { checkErrors(req, res, next) } -function remoteQaduVideosValidator (req, res, next) { +function remoteQaduVideosValidator (req: express.Request, res: express.Response, next: express.NextFunction) { req.checkBody('data').isEachRemoteRequestVideosQaduValid() logger.debug('Checking remoteQaduVideos parameters', { parameters: req.body }) @@ -17,7 +20,7 @@ function remoteQaduVideosValidator (req, res, next) { checkErrors(req, res, next) } -function remoteEventsVideosValidator (req, res, next) { +function remoteEventsVideosValidator (req: express.Request, res: express.Response, next: express.NextFunction) { req.checkBody('data').isEachRemoteRequestVideosEventsValid() logger.debug('Checking remoteEventsVideos parameters', { parameters: req.body }) -- cgit v1.2.3