diff options
author | Chocobozzz <me@florianbigard.com> | 2019-03-19 09:26:50 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-03-19 09:26:50 +0100 |
commit | 0f6acda11681de90d38dd18669863c6e270851ee (patch) | |
tree | b3b28e00d539645f5a810202dc8afada289e7b2e /server/middlewares/validators/account.ts | |
parent | 9a18a6252071cf21b18f82a24bb63078abb75bc1 (diff) | |
download | PeerTube-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.ts | 6 |
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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { param } from 'express-validator/check' | 2 | import { param } from 'express-validator/check' |
3 | import { isAccountNameValid, isAccountNameWithHostExist, isLocalAccountNameExist } from '../../helpers/custom-validators/accounts' | 3 | import { isAccountNameValid, doesAccountNameWithHostExist, doesLocalAccountNameExist } from '../../helpers/custom-validators/accounts' |
4 | import { logger } from '../../helpers/logger' | 4 | import { logger } from '../../helpers/logger' |
5 | import { areValidationErrors } from './utils' | 5 | import { 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 | } |