feat(room): enforce minimum room name length of 2 characters in creation and editing
All checks were successful
Build & Push Docker Image / build (push) Successful in 6m17s
All checks were successful
Build & Push Docker Image / build (push) Successful in 6m17s
This commit is contained in:
@@ -166,6 +166,9 @@ router.post('/', authenticateToken, async (req, res) => {
|
||||
if (!name || name.trim().length === 0) {
|
||||
return res.status(400).json({ error: 'Room name is required' });
|
||||
}
|
||||
if (name.trim().length < 2) {
|
||||
return res.status(400).json({ error: 'Room name must be at least 2 characters' });
|
||||
}
|
||||
|
||||
// M7: field length limits
|
||||
if (name.trim().length > 100) {
|
||||
@@ -243,6 +246,9 @@ router.put('/:uid', authenticateToken, async (req, res) => {
|
||||
} = req.body;
|
||||
|
||||
// M12: field length limits (same as create)
|
||||
if (name && name.trim().length < 2) {
|
||||
return res.status(400).json({ error: 'Room name must be at least 2 characters' });
|
||||
}
|
||||
if (name && name.trim().length > 100) {
|
||||
return res.status(400).json({ error: 'Room name must not exceed 100 characters' });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user