From dd27e59c2cdccbec606e8c470b1c09a7cec31bb3 Mon Sep 17 00:00:00 2001 From: mariomitte Date: Tue, 8 Sep 2026 06:54:39 +0200 Subject: [PATCH] fix: restore generated archive download export Re-add downloadGeneratedArchiveByUrl in fleet dashboard store so notification detail modal imports resolve during frontend build. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- frontend/src/stores/fleetDashboardStore.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/frontend/src/stores/fleetDashboardStore.js b/frontend/src/stores/fleetDashboardStore.js index 82d8bff..7e88851 100644 --- a/frontend/src/stores/fleetDashboardStore.js +++ b/frontend/src/stores/fleetDashboardStore.js @@ -1037,6 +1037,22 @@ export async function downloadGeneratedPdfByUrl(downloadUrl, filename = 'documen } } +export async function downloadGeneratedArchiveByUrl(downloadUrl, filename = 'archive.zip') { + if (!downloadUrl) { + showToast('Nedostaje URL za preuzimanje ZIP arhive.', 'error'); + throw new Error('Nedostaje URL za preuzimanje ZIP arhive.'); + } + try { + const blob = await api.get(downloadUrl, { responseType: 'blob' }); + saveBlobToFile(blob, filename); + return true; + } catch (err) { + const msg = err?.message || 'Preuzimanje ZIP arhive nije uspjelo.'; + showToast(msg, 'error'); + throw err; + } +} + export function openWorkOrderInvoicesPdfPage(workOrderId) { if (!isBrowser() || !workOrderId) { return;