aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/accounts.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-02-15 14:46:26 +0100
committerChocobozzz <me@florianbigard.com>2018-02-15 15:29:07 +0100
commit2422c46b27790d94fd29a7092170cee5a1b56008 (patch)
treed5c1942ce20cadb27a551d87c789edfe92f5b105 /server/helpers/custom-validators/accounts.ts
parent34cbef8c6cc912143a421413bdd832c4adcc556a (diff)
downloadPeerTube-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.ts7
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'
3import 'express-validator' 3import 'express-validator'
4import * as validator from 'validator' 4import * as validator from 'validator'
5import { AccountModel } from '../../models/account/account' 5import { AccountModel } from '../../models/account/account'
6import { isUserUsernameValid } from './users' 6import { isUserDescriptionValid, isUserUsernameValid } from './users'
7 7
8function isAccountNameValid (value: string) { 8function isAccountNameValid (value: string) {
9 return isUserUsernameValid(value) 9 return isUserUsernameValid(value)
10} 10}
11 11
12function isAccountDescriptionValid (value: string) {
13 return isUserDescriptionValid(value)
14}
15
12function isAccountIdExist (id: number | string, res: Response) { 16function 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) {
48export { 52export {
49 isAccountIdExist, 53 isAccountIdExist,
50 isLocalAccountNameExist, 54 isLocalAccountNameExist,
55 isAccountDescriptionValid,
51 isAccountNameValid 56 isAccountNameValid
52} 57}