feat: add validation before creating session

This commit is contained in:
wancat committed 2023-11-01 22:59:32 +08:00
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]