diff options
author | Chocobozzz <me@florianbigard.com> | 2018-02-15 14:46:26 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-02-15 15:29:07 +0100 |
commit | 2422c46b27790d94fd29a7092170cee5a1b56008 (patch) | |
tree | d5c1942ce20cadb27a551d87c789edfe92f5b105 /server/helpers/custom-validators/accounts.ts | |
parent | 34cbef8c6cc912143a421413bdd832c4adcc556a (diff) | |
download | PeerTube-2422c46b27790d94fd29a7092170cee5a1b56008.tar.gz PeerTube-2422c46b27790d94fd29a7092170cee5a1b56008.tar.zst PeerTube-2422c46b27790d94fd29a7092170cee5a1b56008.zip |
Implement support field in video and video channel
Diffstat (limited to 'server/helpers/custom-validators/accounts.ts')
-rw-r--r-- | server/helpers/custom-validators/accounts.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/helpers/custom-validators/accounts.ts b/server/helpers/custom-validators/accounts.ts index 8dc5d1f0d..a46ffc162 100644 --- a/server/helpers/custom-validators/accounts.ts +++ b/server/helpers/custom-validators/accounts.ts | |||
@@ -3,12 +3,16 @@ import { Response } from 'express' | |||
3 | import 'express-validator' | 3 | import 'express-validator' |
4 | import * as validator from 'validator' | 4 | import * as validator from 'validator' |
5 | import { AccountModel } from '../../models/account/account' | 5 | import { AccountModel } from '../../models/account/account' |
6 | import { isUserUsernameValid } from './users' | 6 | import { isUserDescriptionValid, isUserUsernameValid } from './users' |
7 | 7 | ||
8 | function isAccountNameValid (value: string) { | 8 | function isAccountNameValid (value: string) { |
9 | return isUserUsernameValid(value) | 9 | return isUserUsernameValid(value) |
10 | } | 10 | } |
11 | 11 | ||
12 | function isAccountDescriptionValid (value: string) { | ||
13 | return isUserDescriptionValid(value) | ||
14 | } | ||
15 | |||
12 | function isAccountIdExist (id: number | string, res: Response) { | 16 | function isAccountIdExist (id: number | string, res: Response) { |
13 | let promise: Bluebird<AccountModel> | 17 | let promise: Bluebird<AccountModel> |
14 | 18 | ||
@@ -48,5 +52,6 @@ async function isAccountExist (p: Bluebird<AccountModel>, res: Response) { | |||
48 | export { | 52 | export { |
49 | isAccountIdExist, | 53 | isAccountIdExist, |
50 | isLocalAccountNameExist, | 54 | isLocalAccountNameExist, |
55 | isAccountDescriptionValid, | ||
51 | isAccountNameValid | 56 | isAccountNameValid |
52 | } | 57 | } |