Replace notifications with activity feed

This commit is contained in:
Cauê Faleiros
2026-05-29 14:34:40 -03:00
parent 0f322e9c85
commit e64654c820
14 changed files with 154 additions and 313 deletions

View File

@@ -0,0 +1,14 @@
const crypto = require('crypto');
const recordActivity = async (db, { userId, type = 'info', title, message, link = null }) => {
if (!userId || !title || !message) return;
await db.query(
'INSERT INTO notifications (id, user_id, type, title, message, link) VALUES (?, ?, ?, ?, ?, ?)',
[crypto.randomUUID(), userId, type, title, message, link]
);
};
module.exports = {
recordActivity,
};