Datei Upload und Download fix

Dieser Commit ist enthalten in:
hendrik_gebhardt@gmx.de
2026-01-10 20:54:24 +00:00
committet von Server Deploy
Ursprung 5b1f8b1cfe
Commit 671aaadc26
7 geänderte Dateien mit 186 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -58,6 +58,10 @@ const NOTIFICATION_TYPES = {
'approval:rejected': {
title: (data) => 'Genehmigung abgelehnt',
message: (data) => `"${data.proposalTitle}" wurde abgelehnt`
},
'knowledge:new_entry': {
title: (data) => 'Neuer Wissenseintrag',
message: (data) => `Neuer Eintrag: "${data.entryTitle}" in ${data.categoryName}`
}
};
@ -84,8 +88,8 @@ const notificationService = {
const message = typeConfig.message(data);
const result = db.prepare(`
INSERT INTO notifications (user_id, type, title, message, task_id, project_id, proposal_id, actor_id, is_persistent)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
INSERT INTO notifications (user_id, type, title, message, task_id, project_id, proposal_id, actor_id, is_persistent, data)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
`).run(
userId,
type,
@ -95,7 +99,8 @@ const notificationService = {
data.projectId || null,
data.proposalId || null,
data.actorId || null,
persistent ? 1 : 0
persistent ? 1 : 0,
JSON.stringify(data) // Zusätzliche Daten als JSON speichern
);
const notification = db.prepare(`
@ -260,6 +265,16 @@ const notificationService = {
* Benachrichtigung formatieren für Frontend
*/
formatNotification(notification) {
// Parse zusätzliche Daten wenn vorhanden
let additionalData = {};
if (notification.data) {
try {
additionalData = JSON.parse(notification.data);
} catch (e) {
// Ignore parse errors
}
}
return {
id: notification.id,
userId: notification.user_id,
@ -274,7 +289,10 @@ const notificationService = {
actorColor: notification.actor_color,
isRead: notification.is_read === 1,
isPersistent: notification.is_persistent === 1,
createdAt: notification.created_at
createdAt: notification.created_at,
// Zusätzliche Daten für Knowledge-Einträge
entryId: additionalData.entryId || null,
categoryId: additionalData.categoryId || null
};
},