Dateien nach "backend/src/tools/nachrichten" hochladen

This commit is contained in:
2026-05-28 00:54:34 +02:00
parent c9417777bb
commit cf84ebcc2b

View File

@@ -90,7 +90,7 @@ router.post('/messages/:userId', authenticate, async (req, res) => {
if (!recipient) return res.status(404).json({ error: 'Benutzer nicht gefunden' }); if (!recipient) return res.status(404).json({ error: 'Benutzer nicht gefunden' });
const result = db.prepare( const result = db.prepare(
'INSERT INTO messages (sender_id, recipient_id, encrypted_content, iv) VALUES (?, ?, ?, ?)' "INSERT INTO messages (sender_id, recipient_id, encrypted_content, iv, created_at) VALUES (?, ?, ?, ?, datetime('now'))"
).run(me, recipId, encrypted_content, iv); ).run(me, recipId, encrypted_content, iv);
const senderName = db.prepare('SELECT username FROM users WHERE id = ?').get(me)?.username || 'Jemand'; const senderName = db.prepare('SELECT username FROM users WHERE id = ?').get(me)?.username || 'Jemand';