aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/account.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-03-19 09:26:50 +0100
committerChocobozzz <me@florianbigard.com>2019-03-19 09:26:50 +0100
commit0f6acda11681de90d38dd18669863c6e270851ee (patch)
treeb3b28e00d539645f5a810202dc8afada289e7b2e /server/middlewares/validators/account.ts
parent9a18a6252071cf21b18f82a24bb63078abb75bc1 (diff)
downloadPeerTube-0f6acda11681de90d38dd18669863c6e270851ee.tar.gz
PeerTube-0f6acda11681de90d38dd18669863c6e270851ee.tar.zst
PeerTube-0f6acda11681de90d38dd18669863c6e270851ee.zip
Does exist
Diffstat (limited to 'server/middlewares/validators/account.ts')
-rw-r--r--server/middlewares/validators/account.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/middlewares/validators/account.ts b/server/middlewares/validators/account.ts
index 88c57eaa1..96e120a38 100644
--- a/server/middlewares/validators/account.ts
+++ b/server/middlewares/validators/account.ts
@@ -1,6 +1,6 @@
1import * as express from 'express' 1import * as express from 'express'
2import { param } from 'express-validator/check' 2import { param } from 'express-validator/check'
3import { isAccountNameValid, isAccountNameWithHostExist, isLocalAccountNameExist } from '../../helpers/custom-validators/accounts' 3import { isAccountNameValid, doesAccountNameWithHostExist, doesLocalAccountNameExist } from '../../helpers/custom-validators/accounts'
4import { logger } from '../../helpers/logger' 4import { logger } from '../../helpers/logger'
5import { areValidationErrors } from './utils' 5import { areValidationErrors } from './utils'
6 6
@@ -11,7 +11,7 @@ const localAccountValidator = [
11 logger.debug('Checking localAccountValidator parameters', { parameters: req.params }) 11 logger.debug('Checking localAccountValidator parameters', { parameters: req.params })
12 12
13 if (areValidationErrors(req, res)) return 13 if (areValidationErrors(req, res)) return
14 if (!await isLocalAccountNameExist(req.params.name, res)) return 14 if (!await doesLocalAccountNameExist(req.params.name, res)) return
15 15
16 return next() 16 return next()
17 } 17 }
@@ -24,7 +24,7 @@ const accountNameWithHostGetValidator = [
24 logger.debug('Checking accountsNameWithHostGetValidator parameters', { parameters: req.params }) 24 logger.debug('Checking accountsNameWithHostGetValidator parameters', { parameters: req.params })
25 25
26 if (areValidationErrors(req, res)) return 26 if (areValidationErrors(req, res)) return
27 if (!await isAccountNameWithHostExist(req.params.accountName, res)) return 27 if (!await doesAccountNameWithHostExist(req.params.accountName, res)) return
28 28
29 return next() 29 return next()
30 } 30 }