diff --git a/src/app/components/TanstakTable.tsx b/src/app/components/TanstakTable.tsx index ea9e073..203ccf3 100644 --- a/src/app/components/TanstakTable.tsx +++ b/src/app/components/TanstakTable.tsx @@ -48,6 +48,7 @@ type ApiFile = { status: string; protectStatus: string; supportId: number; + fileName: string; }; type ApiResponse = { @@ -474,8 +475,7 @@ export default function TanstakFilesTable({ fileType }: { fileType: string }) { setIsFileLoading(true); try { - /* const response = await fetch(`/api/download/${file.id}`); */ - const response = await fetch(`/api/v1/files/download/${file.id}`); + const response = await fetch(`/api/download/${file.id}`); if (!response.ok) { throw new Error(`error: ${response.status}`); @@ -485,7 +485,7 @@ export default function TanstakFilesTable({ fileType }: { fileType: string }) { const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; - a.download = file.fileName || `file-${file.id}`; + a.download = file._original?.fileName || file.fileName || `file-${file.id}`; document.body.appendChild(a); a.click(); window.URL.revokeObjectURL(url);