import { areValidationErrors, doesAccountNameWithHostExist } from './shared'
const blockAccountValidator = [
- body('accountName').exists().withMessage('Should have an account name with host'),
+ body('accountName')
+ .exists(),
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking blockAccountByAccountValidator parameters', { parameters: req.body })
]
const unblockAccountByAccountValidator = [
- param('accountName').exists().withMessage('Should have an account name with host'),
+ param('accountName')
+ .exists(),
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking unblockAccountByAccountValidator parameters', { parameters: req.params })
]
const unblockAccountByServerValidator = [
- param('accountName').exists().withMessage('Should have an account name with host'),
+ param('accountName')
+ .exists(),
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking unblockAccountByServerValidator parameters', { parameters: req.params })
]
const blockServerValidator = [
- body('host').custom(isHostValid).withMessage('Should have a valid host'),
+ body('host')
+ .custom(isHostValid),
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking serverGetValidator parameters', { parameters: req.body })
]
const unblockServerByAccountValidator = [
- param('host').custom(isHostValid).withMessage('Should have an account name with host'),
+ param('host')
+ .custom(isHostValid),
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking unblockServerByAccountValidator parameters', { parameters: req.params })
]
const unblockServerByServerValidator = [
- param('host').custom(isHostValid).withMessage('Should have an account name with host'),
+ param('host')
+ .custom(isHostValid),
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking unblockServerByServerValidator parameters', { parameters: req.params })