diff --git a/frontend/src/app-components/attachment/AttachmentInput.tsx b/frontend/src/app-components/attachment/AttachmentInput.tsx index 82f3938b..28c7a5ec 100644 --- a/frontend/src/app-components/attachment/AttachmentInput.tsx +++ b/frontend/src/app-components/attachment/AttachmentInput.tsx @@ -46,7 +46,7 @@ const AttachmentInput = forwardRef( ref, ) => { const hasPermission = useHasPermission(); - const handleChange = (attachment: IAttachment | null) => { + const handleChange = (attachment?: IAttachment | null) => { onChange && onChange(attachment?.id || null, attachment?.type || null); }; diff --git a/frontend/src/app-components/attachment/AttachmentUploader.tsx b/frontend/src/app-components/attachment/AttachmentUploader.tsx index 3587367b..2a7f75a4 100644 --- a/frontend/src/app-components/attachment/AttachmentUploader.tsx +++ b/frontend/src/app-components/attachment/AttachmentUploader.tsx @@ -65,7 +65,7 @@ export type FileUploadProps = { imageButton?: boolean; accept: string; enableMediaLibrary?: boolean; - onChange?: (data: IAttachment | null) => void; + onChange?: (data?: IAttachment | null) => void; }; const AttachmentUploader: FC = ({ @@ -99,15 +99,16 @@ const AttachmentUploader: FC = ({ const file = event.target.files.item(0); if (file) { - const acceptedTypes = accept.split(','); - const isValidType = acceptedTypes.some((type) => - file.type === type || file.name.endsWith(type.replace('.*', '')) + const acceptedTypes = accept.split(","); + const isValidType = acceptedTypes.some( + (type) => + file.type === type || file.name.endsWith(type.replace(".*", "")), ); if (!isValidType) { toast.error(t("message.invalid_file_type")); - -return; + + return; } uploadAttachment(file); diff --git a/frontend/src/app-components/dialogs/DeleteDialog.tsx b/frontend/src/app-components/dialogs/DeleteDialog.tsx index f9114992..d5097939 100644 --- a/frontend/src/app-components/dialogs/DeleteDialog.tsx +++ b/frontend/src/app-components/dialogs/DeleteDialog.tsx @@ -43,7 +43,16 @@ export const DeleteDialog: FC = ({ -