mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +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
@@ -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