+const accountsGetValidator = [
+ param('id').custom(isIdOrUUIDValid).withMessage('Should have a valid id'),
+
+ async (req: express.Request, res: express.Response, next: express.NextFunction) => {
+ logger.debug('Checking accountsGetValidator parameters', { parameters: req.params })
+
+ if (areValidationErrors(req, res)) return
+ if (!await isAccountIdExist(req.params.id, res)) return
+
+ return next()
+ }
+]
+
+const accountsNameWithHostGetValidator = [
+ param('nameWithHost').exists().withMessage('Should have an account name with host'),
+
+ async (req: express.Request, res: express.Response, next: express.NextFunction) => {
+ logger.debug('Checking accountsNameWithHostGetValidator parameters', { parameters: req.params })
+
+ if (areValidationErrors(req, res)) return
+ if (!await isAccountNameWithHostExist(req.params.nameWithHost, res)) return
+
+ return next()
+ }
+]
+