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