From 444fcb20873fde43a98589ce07ff21be8db00de3 Mon Sep 17 00:00:00 2001 From: hippoz <10706925-hippoz@users.noreply.gitlab.com> Date: Tue, 26 Apr 2022 04:04:40 +0300 Subject: [PATCH] backend: fix channel name length limits --- src/routes/api/v1/channels.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/api/v1/channels.ts b/src/routes/api/v1/channels.ts index 81862f2..ff882b1 100644 --- a/src/routes/api/v1/channels.ts +++ b/src/routes/api/v1/channels.ts @@ -12,7 +12,7 @@ const router = express.Router(); router.post( "/", authenticateRoute(), - body("name").isLength({ min: 1, max: 40 }).isAlphanumeric("en-US", { ignore: " _-" }), + body("name").isLength({ min: 1, max: 32 }).isAlphanumeric("en-US", { ignore: " _-" }), async (req, res) => { const validationErrors = validationResult(req); if (!validationErrors.isEmpty()) { @@ -43,7 +43,7 @@ router.post( router.put( "/:id", authenticateRoute(), - body("name").isLength({ min: 1, max: 40 }).isAlphanumeric("en-US", { ignore: " _-" }), + body("name").isLength({ min: 1, max: 32 }).isAlphanumeric("en-US", { ignore: " _-" }), param("id").isNumeric(), async (req, res) => { const validationErrors = validationResult(req);