quest: execute

This commit is contained in:
wancat committed 2024-07-26 16:25:38 +08:00
1 parent 8597c22b9f
commit 887d205ec1
6 files changed
+215 -16

No files matched your search

@@ -43,7 +43,10 @@ export const createSession = asyncHandler(
async (req: Request, res: Response) => {
const { questId } = matchedData(req)
const user = await User.findById((req.user as Express.ExistingUser).id)
if (user && (await isQuestUnlocked(user, questId))) {
if (
user &&
((await isQuestUnlocked(user, questId)) || config.testing.enabled)
) {
const session = await createNewSession(user, questId)
res.status(201).json(sessionDetail(session))
} else {