mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 03:20:12 +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
@@ -6,7 +6,6 @@ instruction: |
|
|||||||
|
|
||||||
requirements:
|
requirements:
|
||||||
- helloworld
|
- helloworld
|
||||||
- noexists
|
|
||||||
|
|
||||||
conditions:
|
conditions:
|
||||||
pwd_home: &pwd_home
|
pwd_home: &pwd_home
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ import { Quest } from '@linux-odyssey/models'
|
|||||||
import { matchedData } from 'express-validator'
|
import { matchedData } from 'express-validator'
|
||||||
|
|
||||||
export async function getQuests(req, res) {
|
export async function getQuests(req, res) {
|
||||||
const quests = await Quest.find({}).sort({ order: 1 })
|
const quests = await Quest.find({})
|
||||||
res.json(
|
res.json(
|
||||||
quests.map(({ title, order, _id }) => ({
|
quests.map(({ title, _id, requirements }) => ({
|
||||||
_id,
|
_id,
|
||||||
title,
|
title,
|
||||||
order,
|
requirements,
|
||||||
}))
|
}))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ router.post(
|
|||||||
|
|
||||||
router.post('/register', authenticateRateLimit, registerValidators, register)
|
router.post('/register', authenticateRateLimit, registerValidators, register)
|
||||||
|
|
||||||
router.post('/logout', authenticateRateLimit, logout)
|
router.post('/logout', logout)
|
||||||
|
|
||||||
router.get('/check-username', checkUsernameValidators, (req, res) =>
|
router.get('/check-username', checkUsernameValidators, (req, res) =>
|
||||||
res.json({ available: true })
|
res.json({ available: true })
|
||||||
|
|||||||
Reference in new issue
Block a user