aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/accounts.ts
diff options
context:
space:
mode:
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}