From 6483d04e3283bf44d525422f15958feecb45e4e3 Mon Sep 17 00:00:00 2001 From: Chris Amico Date: Thu, 11 Apr 2024 18:01:30 -0400 Subject: [PATCH] Send original extension for non-pdf docs --- src/lib/components/forms/DocumentUpload.svelte | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/components/forms/DocumentUpload.svelte b/src/lib/components/forms/DocumentUpload.svelte index 84ab2ca9d..3a1220b7c 100644 --- a/src/lib/components/forms/DocumentUpload.svelte +++ b/src/lib/components/forms/DocumentUpload.svelte @@ -26,12 +26,14 @@ // put things together const docs: DocumentUpload[] = titles.map((title, i) => { + const [name, ...ext] = filenames[i].split("."); // don't assume there's only one extension return { title, access, language, projects: projects.map((p: Project) => p.id), revision_control, + original_extension: ext[ext.length - 1], }; });