From b302c80dc0d9ba8eabef9ef6576efe36afc57584 Mon Sep 17 00:00:00 2001 From: Wicklow <123956049+wickloww@users.noreply.github.com> Date: Fri, 7 Apr 2023 08:09:54 +0000 Subject: feature/ability to disable video history by default (#5728) * draft: ability to disable video history by default * Update configuration and add tests * Updated code based on review comments * Add tests on registration and video quota * Remove required video quotas in query * Fix tests --- server/middlewares/validators/config.ts | 1 + server/middlewares/validators/users.ts | 3 +++ 2 files changed, 4 insertions(+) (limited to 'server/middlewares') diff --git a/server/middlewares/validators/config.ts b/server/middlewares/validators/config.ts index c2dbfadb7..4a9d1cb54 100644 --- a/server/middlewares/validators/config.ts +++ b/server/middlewares/validators/config.ts @@ -35,6 +35,7 @@ const customConfigUpdateValidator = [ body('admin.email').isEmail(), body('contactForm.enabled').isBoolean(), + body('user.history.videos.enabled').isBoolean(), body('user.videoQuota').custom(isUserVideoQuotaValid), body('user.videoQuotaDaily').custom(isUserVideoQuotaDailyValid), diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts index f7033f44a..7ebea048d 100644 --- a/server/middlewares/validators/users.ts +++ b/server/middlewares/validators/users.ts @@ -65,8 +65,11 @@ const usersAddValidator = [ .custom(isVideoChannelUsernameValid), body('videoQuota') + .optional() .custom(isUserVideoQuotaValid), + body('videoQuotaDaily') + .optional() .custom(isUserVideoQuotaDailyValid), body('role') -- cgit v1.2.3