From 1324b4b2f7d69e22cc0c83ff1f1df594f69e84ca Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 19 Jul 2021 09:20:50 -0400 Subject: [PATCH] Fix to show file type rather than mime type for attachment --- src/pages/paxDetail/uploadAttachment/UploadAttachment.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pages/paxDetail/uploadAttachment/UploadAttachment.js b/src/pages/paxDetail/uploadAttachment/UploadAttachment.js index a2175e3f..de5c6b03 100644 --- a/src/pages/paxDetail/uploadAttachment/UploadAttachment.js +++ b/src/pages/paxDetail/uploadAttachment/UploadAttachment.js @@ -45,11 +45,19 @@ const UploadAttachment = props => { useEffect(() => { attachment.get.getAllAttachmentsMeta(paxId).then(resp => { + resp = adjustContentType(resp); setData(resp); setTableKey(tableKey + 1); }); }, [refreshDataKey, props.attachmentRefreshKey]); + const adjustContentType = (resp) => { + resp.forEach(data => { + data.contentType = data.filename.split('.')[1]; + }) + return resp; + } + const headers = [ { Accessor: "Actions",