Compare commits

...

2 Commits

Author SHA1 Message Date
Ahmed Bouhuolia
d115ebde12 Merge pull request #755 from bigcapitalhq/fix-upload-attachments
hotbug: upload attachments
2024-11-16 21:23:37 +02:00
Ahmed Bouhuolia
0e99ac88d3 hotbug: upload attachments 2024-11-16 21:23:12 +02:00

View File

@@ -22,7 +22,7 @@ interface AttachmentFileCommon {
size: number; size: number;
mimeType: string; mimeType: string;
} }
interface AttachmentFileLoaded extends AttachmentFileCommon {} interface AttachmentFileLoaded extends AttachmentFileCommon { }
interface AttachmentFileLoading extends AttachmentFileCommon { interface AttachmentFileLoading extends AttachmentFileCommon {
loading: boolean; loading: boolean;
} }
@@ -74,11 +74,11 @@ export function UploadAttachmentsPopoverContent({
}; };
// Uploads the attachments. // Uploads the attachments.
const { mutateAsync: uploadAttachments } = useUploadAttachments({ const { mutateAsync: uploadAttachments } = useUploadAttachments({
onSuccess: (data) => { onSuccess: (data, formData) => {
const newLocalFiles = stopLoadingAttachment( const newLocalFiles = stopLoadingAttachment(
localFiles, localFiles,
data.config.data.get('internalKey'), formData.get('internalKey'),
data.data.data.key, data.key,
); );
handleFilesChange(newLocalFiles); handleFilesChange(newLocalFiles);
onUploadedChange && onUploadedChange(newLocalFiles); onUploadedChange && onUploadedChange(newLocalFiles);