mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +02:00
Server: Add NSFW in user profile
This commit is contained in:
parent
31b59b4774
commit
1d49e1e27d
9 changed files with 90 additions and 8 deletions
|
@ -9,7 +9,8 @@ const USERS_CONSTRAINTS_FIELDS = constants.CONSTRAINTS_FIELDS.USERS
|
|||
const usersValidators = {
|
||||
isUserPasswordValid,
|
||||
isUserRoleValid,
|
||||
isUserUsernameValid
|
||||
isUserUsernameValid,
|
||||
isUserDisplayNSFWValid
|
||||
}
|
||||
|
||||
function isUserPasswordValid (value) {
|
||||
|
@ -26,6 +27,10 @@ function isUserUsernameValid (value) {
|
|||
return validator.matches(value, new RegExp(`^[a-zA-Z0-9._]{${min},${max}}$`))
|
||||
}
|
||||
|
||||
function isUserDisplayNSFWValid (value) {
|
||||
return validator.isBoolean(value)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
module.exports = usersValidators
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue