mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
feat: disable quest locks when testing
This commit is contained in:
1 parent
c7fb0997b7
commit
3f8bcb5446
3 files changed
+4
-4
No files matched your search
@@ -1,3 +1,2 @@
|
||||
title: Read the File
|
||||
title: 建立檔案與資料夾
|
||||
instruction: |
|
||||
閱讀檔案
|
||||
+1
-1
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user