aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/users.js
blob: 41e00d046f10f5d0e9e9f98a56f22a78034ad83c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'use strict'

const validator = require('express-validator').validator

const constants = require('../../initializers/constants')
const USERS_CONSTRAINTS_FIELDS = constants.CONSTRAINTS_FIELDS.USERS

const usersValidators = {
  isUserUsernameValid: isUserUsernameValid
}

function isUserUsernameValid (value) {
  return validator.isLength(value, USERS_CONSTRAINTS_FIELDS.USERNAME)
}

// ---------------------------------------------------------------------------

module.exports = usersValidators