feat: Enhance note creation and project cancellation with user information and translations
This commit is contained in:
@@ -73,6 +73,20 @@ async function createNoteHandler(req) {
|
||||
)
|
||||
.run(project_id || null, task_id || null, note, req.user?.id || null);
|
||||
|
||||
// Get the created note with user info
|
||||
const createdNote = db
|
||||
.prepare(
|
||||
`
|
||||
SELECT n.*,
|
||||
u.name as created_by_name,
|
||||
u.username as created_by_username
|
||||
FROM notes n
|
||||
LEFT JOIN users u ON n.created_by = u.id
|
||||
WHERE n.note_id = ?
|
||||
`
|
||||
)
|
||||
.get(result.lastInsertRowid);
|
||||
|
||||
// Log note creation
|
||||
await logApiActionSafe(
|
||||
req,
|
||||
@@ -85,7 +99,7 @@ async function createNoteHandler(req) {
|
||||
}
|
||||
);
|
||||
|
||||
return NextResponse.json({ success: true });
|
||||
return NextResponse.json(createdNote);
|
||||
} catch (error) {
|
||||
console.error("Error creating note:", error);
|
||||
return NextResponse.json(
|
||||
|
||||
Reference in New Issue
Block a user