backend: fix channel name length limits

This commit is contained in:
hippoz 2022-04-26 04:04:40 +03:00
parent 96da377e4e
commit 444fcb2087
No known key found for this signature in database
GPG key ID: 7C52899193467641

View file

@ -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);