feat: add validation before creating session

This commit is contained in:
wancat authored and Annie Huang committed 2023-11-12 21:23:12 +08:00
1 parent cbe7adc3f8
commit 8e6227d9b4
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]