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>
This commit is contained in:
@@ -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) {
|
export function openWorkOrderInvoicesPdfPage(workOrderId) {
|
||||||
if (!isBrowser() || !workOrderId) {
|
if (!isBrowser() || !workOrderId) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user