isUserPasswordValid,
isUserRoleValid,
isUserUsernameValid,
- isUserVideoQuotaValid
+ isUserVideoQuotaValid,
+ isUserVideoQuotaDailyValid
} from '../../helpers/custom-validators/users'
import { isVideoExist } from '../../helpers/custom-validators/videos'
import { logger } from '../../helpers/logger'
body('password').custom(isUserPasswordValid).withMessage('Should have a valid password'),
body('email').isEmail().withMessage('Should have a valid email'),
body('videoQuota').custom(isUserVideoQuotaValid).withMessage('Should have a valid user quota'),
+ body('videoQuotaDaily').custom(isUserVideoQuotaDailyValid).withMessage('Should have a valid daily user quota'),
body('role').custom(isUserRoleValid).withMessage('Should have a valid role'),
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
param('id').isInt().not().isEmpty().withMessage('Should have a valid id'),
body('email').optional().isEmail().withMessage('Should have a valid email attribute'),
body('videoQuota').optional().custom(isUserVideoQuotaValid).withMessage('Should have a valid user quota'),
+ body('videoQuotaDaily').optional().custom(isUserVideoQuotaDailyValid).withMessage('Should have a valid daily user quota'),
body('role').optional().custom(isUserRoleValid).withMessage('Should have a valid role'),
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
const actor = await ActorModel.loadLocalByName(username)
if (actor) {
res.status(409)
- .send({ error: 'Another actor (account/channel) with this name already exists.' })
+ .send({ error: 'Another actor (account/channel) with this name on this instance already exists or has already existed.' })
.end()
return false
}