fix(standalone): unable to download ZIPs

This commit is contained in:
Elian Doran
2026-03-28 00:26:11 +02:00
parent 8cd7e48e85
commit 8b1d0063ff
2 changed files with 3 additions and 3 deletions

View File

@@ -9,7 +9,7 @@ import TaskContext from "../../services/task_context.js";
import { safeExtractMessageAndStackFromError } from "../../services/utils/index.js";
import { NotFoundError, ValidationError } from "../../errors.js";
function exportBranch(req: Request<{ branchId: string; type: string; format: string; version: string; taskId: string }>, res: Response) {
async function exportBranch(req: Request<{ branchId: string; type: string; format: string; version: string; taskId: string }>, res: Response) {
const { branchId, type, format, version, taskId } = req.params;
const branch = becca.getBranch(branchId);
@@ -25,7 +25,7 @@ function exportBranch(req: Request<{ branchId: string; type: string; format: str
try {
if (type === "subtree" && (format === "html" || format === "markdown" || format === "share")) {
zipExportService.exportToZip(taskContext, branch, format, res);
await zipExportService.exportToZip(taskContext, branch, format, res);
} else if (type === "single") {
if (format !== "html" && format !== "markdown") {
throw new ValidationError("Invalid export type.");

View File

@@ -144,7 +144,7 @@ export function buildSharedApiRoutes({ route, asyncRoute, apiRoute, asyncApiRout
//#region Import/export
asyncRoute(PST, "/api/notes/:parentNoteId/notes-import", [checkApiAuthOrElectron, uploadMiddlewareWithErrorHandling, csrfMiddleware], importRoute.importNotesToBranch, apiResultHandler);
route(PST, "/api/notes/:parentNoteId/attachments-import", [checkApiAuthOrElectron, uploadMiddlewareWithErrorHandling, csrfMiddleware], importRoute.importAttachmentsToNote, apiResultHandler);
route(GET, "/api/branches/:branchId/export/:type/:format/:version/:taskId", [checkApiAuthOrElectron], exportRoute.exportBranch);
asyncRoute(GET, "/api/branches/:branchId/export/:type/:format/:version/:taskId", [checkApiAuthOrElectron], exportRoute.exportBranch);
//#endregion
apiRoute(GET, "/api/quick-search/:searchString", searchRoute.quickSearch);