mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
feat: add validation before creating session
This commit is contained in:
1 parent
bcfdf15559
commit
d4000eb5a6
3 files changed
+26
-4
No files matched your search
@@ -0,0 +1,8 @@
|
||||
import { check } from 'express-validator'
|
||||
import { noError } from '../../middleware/validator.js'
|
||||
|
||||
const checkQuestId = () =>
|
||||
check('quest_id').notEmpty().isString().isLowercase().isLength({ max: 64 })
|
||||
|
||||
export const createSessionValidator = [checkQuestId(), noError]
|
||||
export const activeSessionValidator = [checkQuestId(), noError]
|
||||
Reference in new issue
Block a user