From 382d78d49256dcc64aa6dc2a8ec02a75752dbb04 Mon Sep 17 00:00:00 2001 From: Elijah Date: Sun, 24 May 2026 12:23:25 -0700 Subject: [PATCH] Fix file download URLs to match backend wildcard route parameter instead of query string --- frontend/src/components/OnlyOfficeEditor.tsx | 2 +- frontend/src/lib/api.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/OnlyOfficeEditor.tsx b/frontend/src/components/OnlyOfficeEditor.tsx index 9b7813b..33f9cf2 100644 --- a/frontend/src/components/OnlyOfficeEditor.tsx +++ b/frontend/src/components/OnlyOfficeEditor.tsx @@ -46,7 +46,7 @@ export default function OnlyOfficeEditor({ file, type, onClose }: OnlyOfficeEdit const API_BASE = getApiBase(); // Use the public API_BASE which correctly routes through the Nginx proxy to the Next.js frontend - const fileUrl = `${API_BASE}/files/download/?path=${encodeURIComponent(file.path)}&token=${downloadToken}`; + const fileUrl = `${API_BASE}/files/download/${encodeURIComponent(file.path)}?token=${downloadToken}`; const callbackUrl = `${API_BASE}/public/onlyoffice/callback?path=${encodeURIComponent(file.path)}&token=${downloadToken}`; const baseConfig: any = { diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index f9306e7..ad772e8 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -295,7 +295,7 @@ class ApiClient { } getDownloadUrl(path: string, token: string) { - return `${API_BASE}/api/files/download/?path=${encodeURIComponent(path)}&token=${token}`; + return `${API_BASE}/api/files/download/${encodeURIComponent(path)}?token=${token}`; } getDownloadFolderUrl(path: string, token: string) {