1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 10:19:35 +02:00

Add ability to update the user display name/description

This commit is contained in:
Chocobozzz 2018-04-26 10:03:40 +02:00
parent d62cf3234c
commit ed56ad1193
No known key found for this signature in database
GPG key ID: 583A612D890159BE
23 changed files with 215 additions and 19 deletions

View file

@ -22,6 +22,10 @@ function isUserUsernameValid (value: string) {
return exists(value) && validator.matches(value, new RegExp(`^[a-z0-9._]{${min},${max}}$`))
}
function isUserDisplayNameValid (value: string) {
return value === null || (exists(value) && validator.isLength(value, CONSTRAINTS_FIELDS.USERS.NAME))
}
function isUserDescriptionValid (value: string) {
return value === null || (exists(value) && validator.isLength(value, CONSTRAINTS_FIELDS.USERS.DESCRIPTION))
}
@ -60,6 +64,7 @@ export {
isUserUsernameValid,
isUserNSFWPolicyValid,
isUserAutoPlayVideoValid,
isUserDisplayNameValid,
isUserDescriptionValid,
isAvatarFile
}