some stuff

This commit is contained in:
biglyderv 2024-11-25 14:12:44 -05:00
parent 2c10aa662b
commit a97bded7f5
3 changed files with 21 additions and 3 deletions

View file

@ -34,6 +34,21 @@ let main = new Route([auth], async function (req, res, input) {
content,
'false'
]);
} else if (targetType == 'video') {
let v = await db.all('SELECT * FROM video WHERE id = ?', [
targetId
]);
if (v.length == 0) return;
await db.run('INSERT INTO message (username, targetType, targetId, date, content, read) VALUES (?,?,?,?,?,?)', [
v[0].username,
'video comment',
u,
+new Date(),
content,
'false'
]);
}
res.send({ 'message': 'Comment sent', redirect: u });