From e1057c706e283dc08a0f57b460b9cf957cf7bbb3 Mon Sep 17 00:00:00 2001 From: Mikael Siidorow Date: Mon, 14 Oct 2024 14:54:22 +0300 Subject: [PATCH] fix: encode filenames before posting to laskugeneraattori --- apps/web/src/lib/api/external/laskugeneraattori/actions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/lib/api/external/laskugeneraattori/actions.ts b/apps/web/src/lib/api/external/laskugeneraattori/actions.ts index 50bd3fc5..ecae611b 100644 --- a/apps/web/src/lib/api/external/laskugeneraattori/actions.ts +++ b/apps/web/src/lib/api/external/laskugeneraattori/actions.ts @@ -79,7 +79,7 @@ export async function SaveAction( const data = new FormData(); data.append("data", JSON.stringify(json)); attachments.forEach((attachment) => { - data.append("attachments", attachment); + data.append("attachments", attachment, encodeURIComponent(attachment.name)); }); const res = await fetch(`${laskugeneraattoriBaseUrl}/invoices`, {