From a9bfa85d2cdf13670aaced740da5b493fbeddfce Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 15 Dec 2021 15:58:10 +0100 Subject: Add ability for admins to set default p2p policy --- server/middlewares/validators/users.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'server/middlewares/validators') diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts index 7a6b2ce57..bc6007c6d 100644 --- a/server/middlewares/validators/users.ts +++ b/server/middlewares/validators/users.ts @@ -15,6 +15,7 @@ import { isUserDisplayNameValid, isUserNoModal, isUserNSFWPolicyValid, + isUserP2PEnabledValid, isUserPasswordValid, isUserPasswordValidOrEmpty, isUserRoleValid, @@ -239,6 +240,9 @@ const usersUpdateMeValidator = [ body('autoPlayVideo') .optional() .custom(isUserAutoPlayVideoValid).withMessage('Should have a valid automatically plays video attribute'), + body('p2pEnabled') + .optional() + .custom(isUserP2PEnabledValid).withMessage('Should have a valid p2p enabled boolean'), body('videoLanguages') .optional() .custom(isUserVideoLanguages).withMessage('Should have a valid video languages attribute'), -- cgit v1.2.3