feat: disable quest locks when testing

This commit is contained in:
Lin, Hung-Shin committed 2023-11-21 10:48:35 +08:00
1 parent c7fb0997b7
commit 3f8bcb5446
3 files changed
+4 -4

No files matched your search

+1 -2
View File
@@ -1,3 +1,2 @@
title: Read the File
title: 建立檔案與資料夾
instruction: |
閱讀檔案
+1 -1
View File
@@ -3,8 +3,8 @@ quests:
- cast
- discover
- read
- create
- transport
- create
- copy
- move
- remove
@@ -6,6 +6,7 @@ import {
isQuestUnlocked,
} from '../../models/sessionManager.js'
import { asyncHandler } from '../../middleware/error.js'
import config from '../../config.js'
function sessionSummary(session) {
return {
@@ -65,7 +66,7 @@ export const getSessionById = asyncHandler(async (req, res) => {
export const getOrCreateSession = asyncHandler(async (req, res) => {
const { questId } = matchedData(req)
if (await isQuestUnlocked(req.user, questId)) {
if ((await isQuestUnlocked(req.user, questId)) || config.testing.enable) {
const session = await getOrCreateActiveSession(req.user, questId)
res.json(sessionDetail(session))
} else {