From 9871ef4d8dfe7de2f76a95a8fc26b3b5492a9ae4 Mon Sep 17 00:00:00 2001 From: Ismail Pelaseyed Date: Mon, 18 Sep 2023 19:04:29 +0200 Subject: [PATCH] Fix issue with text/plain mimetypes (#386) * Fix issue with text/plain mimetypes * Minor tweaks --- libs/ui/app/datasources/data-table.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/ui/app/datasources/data-table.tsx b/libs/ui/app/datasources/data-table.tsx index a8226b5ce..2ffbd7768 100644 --- a/libs/ui/app/datasources/data-table.tsx +++ b/libs/ui/app/datasources/data-table.tsx @@ -168,9 +168,10 @@ export function DataTable({ }), }) const { publicUrl } = await response.json() + const fileType = file.mime_type.split("/").pop().toUpperCase() form.setValue("url", publicUrl) - form.setValue("type", file.mime_type.split("/").pop().toUpperCase()) + form.setValue("type", fileType === "PLAIN" ? "TXT" : fileType) setIsDownloadingFile(false) }, })