feat: Enhance note creation and project cancellation with user information and translations
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user