some more ui stuff
This commit is contained in:
parent
9e5989825f
commit
d65c737a6e
5 changed files with 60 additions and 42 deletions
|
@ -35,8 +35,6 @@ router.get('/:id', async (req, res, next) => {
|
|||
|
||||
replies = replies.filter(x => x.comment != 'fail');
|
||||
|
||||
console.log(replies)
|
||||
|
||||
res.ctx.mainPage = 'commenter'
|
||||
res.ctx.mainCtx = {
|
||||
replies
|
||||
|
|
|
@ -37,6 +37,11 @@ router.get('/get/:type/:id/:num', async (req, res, next) => {
|
|||
req.params.num * 10
|
||||
]);
|
||||
|
||||
replies.splice(0, 0, {
|
||||
childType: 'comment',
|
||||
childId: req.params.id
|
||||
})
|
||||
|
||||
for (let reply of replies) {
|
||||
let dat = await db.all('SELECT * FROM comment WHERE id = ?', [
|
||||
reply.childId
|
||||
|
@ -50,6 +55,7 @@ router.get('/get/:type/:id/:num', async (req, res, next) => {
|
|||
reply.comment.id = reply.childId;
|
||||
}
|
||||
|
||||
let comment = replies.splice(0, 1)[0];
|
||||
replies = replies.filter(x => x.comment != 'fail');
|
||||
|
||||
res.ctx.mainPage = 'replies'
|
||||
|
@ -59,7 +65,9 @@ router.get('/get/:type/:id/:num', async (req, res, next) => {
|
|||
|
||||
opLink: `/${req.params.type}/${req.params.id}`,
|
||||
type: req.params.type,
|
||||
id: req.params.id
|
||||
id: req.params.id,
|
||||
|
||||
comment
|
||||
}
|
||||
next();
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue