mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
feat: delete "deleteSession" method, validate questId and sessionId
This commit is contained in:
1 parent
a7422853fa
commit
5df4967a85
12 files changed
+67
-99
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { Quest } from '@linux-odyssey/models'
|
||||
import { matchedData } from 'express-validator'
|
||||
|
||||
export async function getQuests(req, res) {
|
||||
const quests = await Quest.find({}).sort({ order: 1 })
|
||||
@@ -12,8 +13,8 @@ export async function getQuests(req, res) {
|
||||
}
|
||||
|
||||
export async function getQuestDetail(req, res) {
|
||||
const { id } = req.params
|
||||
const quest = await Quest.findById(id)
|
||||
const { questId } = matchedData(req)
|
||||
const quest = await Quest.findById(questId)
|
||||
if (!quest) {
|
||||
res.status(404).json({ message: 'Quest not found.' })
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user