some stuff
This commit is contained in:
parent
2c10aa662b
commit
a97bded7f5
3 changed files with 21 additions and 3 deletions
|
@ -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 });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue