mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-07 19:10:12 +08:00
feat: allow testing on creating new session
This commit is contained in:
1 parent
6400aa4a56
commit
d577656eb1
1 file changed
+4
-1
@@ -43,7 +43,10 @@ export const createSession = asyncHandler(
|
|||||||
async (req: Request, res: Response) => {
|
async (req: Request, res: Response) => {
|
||||||
const { questId } = matchedData(req)
|
const { questId } = matchedData(req)
|
||||||
const user = await User.findById((req.user as Express.ExistingUser).id)
|
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)
|
const session = await createNewSession(user, questId)
|
||||||
res.status(201).json(sessionDetail(session))
|
res.status(201).json(sessionDetail(session))
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in new issue
Block a user