bigly-video/client/user.js

19 lines
454 B
JavaScript
Raw Normal View History

2024-11-25 14:12:43 -05:00
import Route from "../route.js";
2024-11-25 14:12:43 -05:00
import comment from "./comment.js";
2024-11-25 14:12:43 -05:00
import initDb from "../db.js";
let db = await initDb();
2024-11-25 14:12:43 -05:00
let main = new Route([comment], async function (req, res, input) {
2024-11-25 14:12:43 -05:00
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', {
2024-11-25 14:12:43 -05:00
...input,
2024-11-25 14:12:43 -05:00
id,
videos
});
});
export default main;