Merge pull request #755 from bigcapitalhq/fix-upload-attachments

hotbug: upload attachments
This commit is contained in:
Ahmed Bouhuolia
2024-11-16 21:23:37 +02:00
committed by GitHub

View File

@@ -74,11 +74,11 @@ export function UploadAttachmentsPopoverContent({
};
// Uploads the attachments.
const { mutateAsync: uploadAttachments } = useUploadAttachments({
onSuccess: (data) => {
onSuccess: (data, formData) => {
const newLocalFiles = stopLoadingAttachment(
localFiles,
data.config.data.get('internalKey'),
data.data.data.key,
formData.get('internalKey'),
data.key,
);
handleFilesChange(newLocalFiles);
onUploadedChange && onUploadedChange(newLocalFiles);