fix(server): async routes causing transaction issues

This commit is contained in:
Elian Doran
2025-05-14 22:58:53 +03:00
parent c8ace1e0b2
commit a333f8a59a
3 changed files with 62 additions and 55 deletions

View File

@@ -101,7 +101,7 @@ async function importNotesToBranch(req: Request) {
return note.getPojo();
}
async function importAttachmentsToNote(req: Request) {
function importAttachmentsToNote(req: Request) {
const { parentNoteId } = req.params;
const { taskId, last } = req.body;
@@ -121,7 +121,7 @@ async function importAttachmentsToNote(req: Request) {
// unlike in note import, we let the events run, because a huge number of attachments is not likely
try {
await singleImportService.importAttachment(taskContext, file, parentNote);
singleImportService.importAttachment(taskContext, file, parentNote);
} catch (e: unknown) {
const [errMessage, errStack] = safeExtractMessageAndStackFromError(e);