backend: fix channel name length limits
This commit is contained in:
parent
96da377e4e
commit
444fcb2087
1 changed files with 2 additions and 2 deletions
|
@ -12,7 +12,7 @@ const router = express.Router();
|
||||||
router.post(
|
router.post(
|
||||||
"/",
|
"/",
|
||||||
authenticateRoute(),
|
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) => {
|
async (req, res) => {
|
||||||
const validationErrors = validationResult(req);
|
const validationErrors = validationResult(req);
|
||||||
if (!validationErrors.isEmpty()) {
|
if (!validationErrors.isEmpty()) {
|
||||||
|
@ -43,7 +43,7 @@ router.post(
|
||||||
router.put(
|
router.put(
|
||||||
"/:id",
|
"/:id",
|
||||||
authenticateRoute(),
|
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(),
|
param("id").isNumeric(),
|
||||||
async (req, res) => {
|
async (req, res) => {
|
||||||
const validationErrors = validationResult(req);
|
const validationErrors = validationResult(req);
|
||||||
|
|
Loading…
Reference in a new issue