hotbug: upload attachments

This commit is contained in:
Ahmed Bouhuolia
2024-11-16 21:23:12 +02:00
parent 5d6f901d33
commit 0e99ac88d3

View File

@@ -22,7 +22,7 @@ interface AttachmentFileCommon {
size: number;
mimeType: string;
}
interface AttachmentFileLoaded extends AttachmentFileCommon {}
interface AttachmentFileLoaded extends AttachmentFileCommon { }
interface AttachmentFileLoading extends AttachmentFileCommon {
loading: boolean;
}
@@ -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);