mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
feat: add requirements in quest list api
This commit is contained in:
1 parent
f973982ec4
commit
4ee88fe7ba
3 files changed
+4
-5
No files matched your search
@@ -2,12 +2,12 @@ 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 })
|
||||
const quests = await Quest.find({})
|
||||
res.json(
|
||||
quests.map(({ title, order, _id }) => ({
|
||||
quests.map(({ title, _id, requirements }) => ({
|
||||
_id,
|
||||
title,
|
||||
order,
|
||||
requirements,
|
||||
}))
|
||||
)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user