19 lines
No EOL
454 B
JavaScript
19 lines
No EOL
454 B
JavaScript
import Route from "../route.js";
|
|
import comment from "./comment.js";
|
|
import initDb from "../db.js";
|
|
|
|
let db = await initDb();
|
|
|
|
let main = new Route([comment], async function (req, res, input) {
|
|
let { id } = req.query;
|
|
let videos = await db.all('SELECT * FROM video WHERE username = ? ORDER BY date DESC', [
|
|
req.query.id
|
|
]);
|
|
return res.render('user', {
|
|
...input,
|
|
id,
|
|
videos
|
|
});
|
|
});
|
|
|
|
export default main; |