add following feed
This commit is contained in:
parent
a9267bf944
commit
220aba76dc
2 changed files with 10 additions and 2 deletions
|
@ -6,11 +6,15 @@ let db = await initDb();
|
|||
|
||||
let main = new Route([auth], async function (req, res, input) {
|
||||
let { username } = input;
|
||||
let videos = await db.all('SELECT * FROM video ORDER BY date DESC LIMIT 10', [
|
||||
let videos = await db.all('SELECT * FROM video ORDER BY date DESC LIMIT 20', [
|
||||
]);
|
||||
let videosFollow = await db.all('SELECT * FROM video WHERE username IN (SELECT target FROM follow WHERE username = ?) ORDER BY date DESC LIMIT 20', [
|
||||
username
|
||||
]);
|
||||
return res.render('main', {
|
||||
username,
|
||||
videos
|
||||
videos,
|
||||
videosFollow
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -18,6 +18,10 @@
|
|||
<%- include ('guidelines.ejs') -%>
|
||||
</details>
|
||||
</div>
|
||||
<h1 class='content-header'>Follow Feed</h1>
|
||||
<div class=' videos'>
|
||||
<%- include('videos.ejs', {videos: videosFollow}) -%>
|
||||
</div>
|
||||
<h1 class='content-header'>Recent Videos</h1>
|
||||
<div class=' videos'>
|
||||
<%- include('videos.ejs') -%>
|
||||
|
|
Loading…
Reference in a new issue