From 94728602183701bae1970e0fbeb1b5f38f24832f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=99=8D=EC=B0=BD=EA=B8=B0?= Date: Mon, 30 Sep 2024 12:55:59 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20build=20=EC=8B=A4=ED=8C=A8=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0,=20refetch=20=EC=84=A0=ED=83=9D=EC=A0=81=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EB=B0=9B=EC=9D=84=20=EC=88=98=20=EC=9E=88=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ImageUploadFileModal/ImageUploadFileForm.tsx | 10 ++++++++-- .../ImageUploadFolderModal/ImageUploadFolderForm.tsx | 10 ++++++++-- .../ImageUploadZipModal/ImageUploadZipForm.tsx | 10 ++++++++-- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/ImageUploadFileModal/ImageUploadFileForm.tsx b/frontend/src/components/ImageUploadFileModal/ImageUploadFileForm.tsx index d90e45e..916d223 100644 --- a/frontend/src/components/ImageUploadFileModal/ImageUploadFileForm.tsx +++ b/frontend/src/components/ImageUploadFileModal/ImageUploadFileForm.tsx @@ -13,7 +13,7 @@ export default function ImageUploadFileForm({ folderId, }: { onClose: () => void; - onRefetch: () => void; + onRefetch?: () => void; onFileCount: (fileCount: number) => void; projectId: number; folderId: number; @@ -34,6 +34,12 @@ export default function ImageUploadFileForm({ onClose(); }; + const handleRefetch = () => { + if (onRefetch) { + onRefetch(); + } + }; + const handleChange = (event: React.ChangeEvent) => { const newFiles = event.target.files; @@ -82,7 +88,7 @@ export default function ImageUploadFileForm({ }, { onSuccess: () => { - onRefetch(); + handleRefetch(); setIsUploaded(true); }, onError: () => { diff --git a/frontend/src/components/ImageUploadFolderModal/ImageUploadFolderForm.tsx b/frontend/src/components/ImageUploadFolderModal/ImageUploadFolderForm.tsx index 754d648..aaaae3a 100644 --- a/frontend/src/components/ImageUploadFolderModal/ImageUploadFolderForm.tsx +++ b/frontend/src/components/ImageUploadFolderModal/ImageUploadFolderForm.tsx @@ -12,7 +12,7 @@ export default function ImageUploadFolderForm({ folderId, }: { onClose: () => void; - onRefetch: () => void; + onRefetch?: () => void; projectId: number; folderId: number; }) { @@ -32,6 +32,12 @@ export default function ImageUploadFolderForm({ onClose(); }; + const handleRefetch = () => { + if (onRefetch) { + onRefetch(); + } + }; + const handleChange = (event: React.ChangeEvent) => { const newFiles = event.target.files; @@ -75,7 +81,7 @@ export default function ImageUploadFolderForm({ }, { onSuccess: () => { - onRefetch; + handleRefetch(); setIsUploaded(true); }, onError: () => { diff --git a/frontend/src/components/ImageUploadZipModal/ImageUploadZipForm.tsx b/frontend/src/components/ImageUploadZipModal/ImageUploadZipForm.tsx index 19a5054..de2ae79 100644 --- a/frontend/src/components/ImageUploadZipModal/ImageUploadZipForm.tsx +++ b/frontend/src/components/ImageUploadZipModal/ImageUploadZipForm.tsx @@ -12,7 +12,7 @@ export default function ImageUploadZipForm({ folderId, }: { onClose: () => void; - onRefetch: () => void; + onRefetch?: () => void; projectId: number; folderId: number; }) { @@ -32,6 +32,12 @@ export default function ImageUploadZipForm({ onClose(); }; + const handleRefetch = () => { + if (onRefetch) { + onRefetch(); + } + }; + const handleChange = (event: React.ChangeEvent) => { const newFiles = event.target.files; @@ -76,7 +82,7 @@ export default function ImageUploadZipForm({ }, { onSuccess: () => { - onRefetch(); + handleRefetch(); setIsUploaded(true); }, onError: () => {