Skip to content

Commit

Permalink
Fix issue with text/plain mimetypes (superagent-ai#386)
Browse files Browse the repository at this point in the history
* Fix issue with text/plain mimetypes

* Minor tweaks
  • Loading branch information
homanp authored Sep 18, 2023
1 parent e7d7c6d commit 9871ef4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libs/ui/app/datasources/data-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,10 @@ export function DataTable<TData, TValue>({
}),
})
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)
},
})
Expand Down

0 comments on commit 9871ef4

Please sign in to comment.