download url

This commit is contained in:
2025-11-22 00:28:11 +01:00
parent dd7dae5f9d
commit c50372af06
6 changed files with 35 additions and 51 deletions
+4 -5
View File
@@ -38,7 +38,9 @@ interface DocumentLike {
correspondents?: Array<{ id?: string | number; name?: string }>;
current_version?: {
version_number?: number;
download?: { url?: string | null; expires_at?: number } | null;
version?: { content_type?: string | null } | null;
filename?: string | null;
} | null;
documentLink?: {
url: string;
@@ -261,11 +263,8 @@ const DocumentViewerPanel: React.FC<DocumentViewerPanelProps> = ({
if (!document) {
return null;
}
const downloadPath = document.current_version?.download_path;
if (!downloadPath) {
return null;
}
const href = resolveApiPath ? resolveApiPath(downloadPath) : downloadPath;
const downloadUrl = document.current_version?.download?.url;
const href = resolveApiPath ? resolveApiPath(downloadUrl) : downloadUrl;
if (!href) {
return null;
}