You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
579 B
23 lines
579 B
const express = require("express")
|
|
const router = express.Router()
|
|
|
|
const common = require("./common")
|
|
const {storyApi} = require("../../rpdata/api/Story")
|
|
|
|
const listTemplate = require("../../marko/page/story/list.marko")
|
|
|
|
router.get("/:author", common, async(req, res) => {
|
|
res.locals.menuAuthor = req.params.author
|
|
|
|
try {
|
|
res.markoAsync(listTemplate, {
|
|
stories: storyApi.list({author: req.params.author}),
|
|
menuAuthor: req.params.author,
|
|
selected: {special: "author"},
|
|
})
|
|
} catch(err) {
|
|
console.error(err)
|
|
}
|
|
})
|
|
|
|
module.exports = router
|