From 3d4f7d88606118d99dc5bfe33db1dce1a226b24a Mon Sep 17 00:00:00 2001 From: jorgep Date: Fri, 22 Nov 2024 11:08:32 +0100 Subject: [PATCH 1/2] fix: refs #7229 set url --- src/composables/downloadFile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/composables/downloadFile.js b/src/composables/downloadFile.js index ef1a1093e..4588265a2 100644 --- a/src/composables/downloadFile.js +++ b/src/composables/downloadFile.js @@ -9,7 +9,7 @@ const token = getTokenMultimedia(); export async function downloadFile(id, model = 'dms', urlPath = '/downloadFile', url) { const appUrl = (await getUrl('', 'lilium')).replace('/#/', ''); const response = await axios.get( - url ?? `${appUrl}/${model}/${id}${urlPath}?access_token=${token}`, + url ?? `${appUrl}/api/${model}/${id}${urlPath}?access_token=${token}`, { responseType: 'blob' } ); From 1beeccef7ac7a723a73a05963b842e502199ae1e Mon Sep 17 00:00:00 2001 From: jorgep Date: Fri, 22 Nov 2024 11:17:47 +0100 Subject: [PATCH 2/2] fix: refs #7229 test --- test/vitest/__tests__/composables/downloadFile.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/vitest/__tests__/composables/downloadFile.spec.js b/test/vitest/__tests__/composables/downloadFile.spec.js index 8d480fcef..f53b56b3e 100644 --- a/test/vitest/__tests__/composables/downloadFile.spec.js +++ b/test/vitest/__tests__/composables/downloadFile.spec.js @@ -29,7 +29,7 @@ describe('downloadFile', () => { await downloadFile(1); expect(axios.get).toHaveBeenCalledWith( - `${baseUrl}/dms/1/downloadFile?access_token=${token}`, + `${baseUrl}/api/dms/1/downloadFile?access_token=${token}`, { responseType: 'blob' } ); });