feat(audit-logging): Replace req.session with req.auth for audit logging in notes and projects

This commit is contained in:
Chop
2025-07-10 00:08:59 +02:00
parent b1a78bf7a8
commit 38b0682d83
8 changed files with 423 additions and 8 deletions

View File

@@ -33,7 +33,7 @@ async function createNoteHandler(req) {
AUDIT_ACTIONS.NOTE_CREATE,
RESOURCE_TYPES.NOTE,
result.lastInsertRowid.toString(),
req.session,
req.auth, // Use req.auth instead of req.session
{
noteData: { project_id, task_id, note_length: note.length },
}
@@ -63,7 +63,7 @@ async function deleteNoteHandler(req, { params }) {
AUDIT_ACTIONS.NOTE_DELETE,
RESOURCE_TYPES.NOTE,
id,
req.session,
req.auth, // Use req.auth instead of req.session
{
deletedNote: {
project_id: note?.project_id,
@@ -101,7 +101,7 @@ async function updateNoteHandler(req, { params }) {
AUDIT_ACTIONS.NOTE_UPDATE,
RESOURCE_TYPES.NOTE,
noteId,
req.session,
req.auth, // Use req.auth instead of req.session
{
originalNote: {
note_length: originalNote?.note?.length || 0,