From 805d83d24a23b8e25337bbffeb3fc12cbe8a32dc Mon Sep 17 00:00:00 2001 From: gs0428 Date: Thu, 15 Feb 2024 02:09:13 +0900 Subject: [PATCH] =?UTF-8?q?feature-065:=20unique=20key=20=EB=B6=80?= =?UTF-8?q?=EC=97=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/category/DefaultMenu.tsx | 4 ++-- src/pages/CategoryPage.tsx | 2 +- src/utils/handleVideo.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/category/DefaultMenu.tsx b/src/components/category/DefaultMenu.tsx index 8521a92..eb355d2 100644 --- a/src/components/category/DefaultMenu.tsx +++ b/src/components/category/DefaultMenu.tsx @@ -30,7 +30,7 @@ const DefaultMenu = ({ <>
{menus.map((menu: ISubFolderProps | ITagProps) => ( - <> +
{'tag_id' in menu && ( )} - +
))}
diff --git a/src/pages/CategoryPage.tsx b/src/pages/CategoryPage.tsx index e48c5fd..ac9eb6b 100644 --- a/src/pages/CategoryPage.tsx +++ b/src/pages/CategoryPage.tsx @@ -121,7 +121,7 @@ const CategoryPage = () => { video={video} checkedVideos={checkedVideos} setCheckedVideos={setCheckedVideos} - key={video.category_id} + key={video.video_id} /> ); })} diff --git a/src/utils/handleVideo.ts b/src/utils/handleVideo.ts index ab90820..f6301a3 100644 --- a/src/utils/handleVideo.ts +++ b/src/utils/handleVideo.ts @@ -13,7 +13,7 @@ const handleVideo = async ( setName: React.Dispatch>, setVideos: React.Dispatch>, ) => { - await getVideoById(topCategoryId).then((res) => { + await getVideoById(topCategoryId).then(async (res) => { const topCategory = categories.find( (category) => category.categoryId === Number(topCategoryId), ); @@ -22,7 +22,7 @@ const handleVideo = async ( (subFolder) => subFolder.categoryId === Number(subCategoryId), ); setName(subName!.name); - getCategoryTags(subCategoryId!).then((res) => { + await getCategoryTags(subCategoryId!).then((res) => { if (res.isSuccess) setMenus(res.result.tags); else setMenus([]); });