From 34f1d4b876349959871a898773c5db558c57af50 Mon Sep 17 00:00:00 2001 From: Timo Vink Date: Tue, 7 Jan 2025 14:04:53 -0500 Subject: [PATCH] Fix attachment URLs. --- web/app/(main)/emails/components-client.jsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/web/app/(main)/emails/components-client.jsx b/web/app/(main)/emails/components-client.jsx index 05ee78c..2ac97ce 100644 --- a/web/app/(main)/emails/components-client.jsx +++ b/web/app/(main)/emails/components-client.jsx @@ -14,9 +14,14 @@ import ClientOnly from '@/components/clientonly'; import './email.css'; -const handleDownload = async (uri, name) => { +const handleDownload = async (path, name) => { // Download as blob - const response = await fetch(uri, { method: 'GET' }); + const url = `https://static.jackievink.com/${path}`; + const response = await fetch(url, { method: 'GET' }); + if (!response.ok) { + console.error('Failed to download file'); + return; + } const blob = await response.blob(); // Create and click a link element