1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Add reason when banning a user

This commit is contained in:
Chocobozzz 2018-08-08 17:36:10 +02:00
parent a6ce68673a
commit eacb25c436
No known key found for this signature in database
GPG key ID: 583A612D890159BE
24 changed files with 215 additions and 44 deletions

View file

@ -42,6 +42,10 @@ function isUserBlockedValid (value: any) {
return isBooleanValid(value)
}
function isUserBlockedReasonValid (value: any) {
return value === null || (exists(value) && validator.isLength(value, CONSTRAINTS_FIELDS.USERS.BLOCKED_REASON))
}
function isUserRoleValid (value: any) {
return exists(value) && validator.isInt('' + value) && UserRole[value] !== undefined
}
@ -59,6 +63,7 @@ function isAvatarFile (files: { [ fieldname: string ]: Express.Multer.File[] } |
export {
isUserBlockedValid,
isUserPasswordValid,
isUserBlockedReasonValid,
isUserRoleValid,
isUserVideoQuotaValid,
isUserUsernameValid,