Resolved Document upload size limit & email attachments

This commit is contained in:
Patrick Fic
2021-04-21 15:26:38 -07:00
parent 09e1ab7f83
commit e57f4b7382
5 changed files with 8 additions and 7 deletions

View File

@@ -55,7 +55,6 @@ export function DocumentsUploadComponent({
multiple={true} multiple={true}
fileList={fileList} fileList={fileList}
onChange={(f) => { onChange={(f) => {
console.log(`f`, f);
if (f.event && f.event.percent === 100) handleDone(f.file.uid); if (f.event && f.event.percent === 100) handleDone(f.file.uid);
setFileList(f.fileList); setFileList(f.fileList);
}} }}

View File

@@ -134,7 +134,7 @@ export const uploadToCloudinary = async (
type: fileType, type: fileType,
extension: extension, extension: extension,
bodyshopid: bodyshop.id, bodyshopid: bodyshop.id,
size: file.size || cloudinaryUploadResponse.data.bytes, size: cloudinaryUploadResponse.data.bytes || file.size,
}, },
], ],
}, },

View File

@@ -58,15 +58,17 @@ export default function EmailOverlayComponent({ form }) {
valuePropName="fileList" valuePropName="fileList"
getValueFromEvent={(e) => { getValueFromEvent={(e) => {
console.log("Upload event:", e); console.log("Upload event:", e);
if (Array.isArray(e)) { if (Array.isArray(e)) {
return e; return e;
} }
return e && e.fileList; return e && e.fileList;
}} }}
> >
<Upload.Dragger multiple listType="picture-card"> <Upload.Dragger
beforeUpload={Upload.LIST_IGNORE}
multiple
listType="picture-card"
>
<> <>
<p className="ant-upload-drag-icon"> <p className="ant-upload-drag-icon">
<UploadOutlined /> <UploadOutlined />

View File

@@ -60,7 +60,7 @@ export function EmailOverlayContainer({
const t = { const t = {
ContentType: f.type, ContentType: f.type,
Filename: f.name, Filename: f.name,
Base64Content: (await toBase64(f)).split(",")[1], Base64Content: (await toBase64(f.originFileObj)).split(",")[1],
}; };
attachments.push(t); attachments.push(t);
}); });

View File

@@ -65,7 +65,7 @@ export function JobsDocumentsGalleryReassign({ bodyshop, galleryImages }) {
}); });
} }
}; };
console.log("selectedImages :>> ", selectedImages);
const handleFinish = async ({ jobid }) => { const handleFinish = async ({ jobid }) => {
setLoading(true); setLoading(true);