]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/account.ts
Cleanup useless express validator messages
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / account.ts
index cbdcef2fd480298ab4f966f8c5bf0413138d77d4..a7534ced523441c8b4d1bd11c840cb6b70901da6 100644 (file)
@@ -1,12 +1,12 @@
-import * as express from 'express'
+import express from 'express'
 import { param } from 'express-validator'
 import { isAccountNameValid } from '../../helpers/custom-validators/accounts'
 import { logger } from '../../helpers/logger'
-import { areValidationErrors } from './utils'
-import { doesAccountNameWithHostExist, doesLocalAccountNameExist } from '../../helpers/middlewares'
+import { areValidationErrors, doesAccountNameWithHostExist, doesLocalAccountNameExist } from './shared'
 
 const localAccountValidator = [
-  param('name').custom(isAccountNameValid).withMessage('Should have a valid account name'),
+  param('name')
+    .custom(isAccountNameValid),
 
   async (req: express.Request, res: express.Response, next: express.NextFunction) => {
     logger.debug('Checking localAccountValidator parameters', { parameters: req.params })
@@ -19,7 +19,8 @@ const localAccountValidator = [
 ]
 
 const accountNameWithHostGetValidator = [
-  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 accountsNameWithHostGetValidator parameters', { parameters: req.params })