Skip to content

Commit f2f4274

Browse files
authored
Merge pull request #471 from amahuli03/file-download-error
Fix: File downloads and opens used wrong API URL
2 parents a8f5d90 + 128418b commit f2f4274

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

frontend/src/pages/Files/ListOfFiles.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const ListOfFiles: React.FC<{ showTable?: boolean }> = ({
6161
const handleDownload = async (guid: string, fileName: string) => {
6262
try {
6363
setDownloading(guid);
64-
const { data } = await publicApi.get(`/v1/api/uploadFile/${guid}`, { responseType: 'blob' });
64+
const { data } = await publicApi.get(`/api/v1/api/uploadFile/${guid}`, { responseType: 'blob' });
6565

6666
const url = window.URL.createObjectURL(new Blob([data]));
6767
const link = document.createElement("a");
@@ -82,7 +82,7 @@ const ListOfFiles: React.FC<{ showTable?: boolean }> = ({
8282
const handleOpen = async (guid: string) => {
8383
try {
8484
setOpening(guid);
85-
const { data } = await publicApi.get(`/v1/api/uploadFile/${guid}`, { responseType: 'arraybuffer' });
85+
const { data } = await publicApi.get(`/api/v1/api/uploadFile/${guid}`, { responseType: 'arraybuffer' });
8686

8787
const file = new Blob([data], { type: 'application/pdf' });
8888
const fileURL = window.URL.createObjectURL(file);

0 commit comments

Comments
 (0)