feat: Enhance note creation and project cancellation with user information and translations

This commit is contained in:
2025-09-18 11:11:22 +02:00
parent 1a49919000
commit 8964a9b29b
6 changed files with 52 additions and 6 deletions

View File

@@ -17,6 +17,7 @@ import {
AUDIT_ACTIONS,
RESOURCE_TYPES,
} from "@/lib/auditLogSafe.js";
import { getUserLanguage, serverT } from "@/lib/serverTranslations";
// Make sure the DB is initialized before queries run
initializeDatabase();
@@ -86,7 +87,8 @@ async function updateProjectHandler(req, { params }) {
minute: '2-digit'
});
const cancellationNote = `Projekt został wycofany w dniu ${cancellationDate}`;
const language = getUserLanguage();
const cancellationNote = `${serverT("Project cancelled on", language)} ${cancellationDate}`;
try {
addNoteToProject(parseInt(id), cancellationNote, userId, true); // true for is_system