mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
feat: add hints to session, update API
This commit is contained in:
1 parent
ae61bfc768
commit
6f368f761e
8 files changed
+52
-46
No files matched your search
@@ -3,9 +3,8 @@ import Quest from '../../models/quest.js'
|
||||
export async function getQuests(req, res) {
|
||||
const quests = await Quest.find({}).sort({ order: 1 })
|
||||
res.json(
|
||||
quests.map(({ name, title, order, _id }) => ({
|
||||
quests.map(({ title, order, _id }) => ({
|
||||
_id,
|
||||
name,
|
||||
title,
|
||||
order,
|
||||
}))
|
||||
@@ -19,5 +18,6 @@ export async function getQuestDetail(req, res) {
|
||||
res.status(404).json({ message: 'Quest not found.' })
|
||||
return
|
||||
}
|
||||
res.json(quest)
|
||||
const { _id, title, order, instruction } = quest
|
||||
res.json({ _id, title, order, instruction })
|
||||
}
|
||||
Reference in new issue
Block a user