From cc64f24918ea04df6048e758a6b33fc31f837eb1 Mon Sep 17 00:00:00 2001 From: LillianHo5 Date: Mon, 27 May 2024 15:07:14 -0700 Subject: [PATCH] Attempt to resolve unsafe member access and promise error in all-pages --- admin-portal-frontend/src/app/all-page/page.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/admin-portal-frontend/src/app/all-page/page.tsx b/admin-portal-frontend/src/app/all-page/page.tsx index 6d20b69..a38765e 100644 --- a/admin-portal-frontend/src/app/all-page/page.tsx +++ b/admin-portal-frontend/src/app/all-page/page.tsx @@ -16,14 +16,13 @@ export default function CategoriesPage() { const fetchData = async () => { try { const fetchedCategories = (await getAllCategories()) as Category[]; - console.log(fetchedCategories); setCategories(fetchedCategories as never); } catch (error) { - console.error("Error fetching categories:", error); + console.log("Fetch categories failed."); } }; - fetchData(); + void fetchData(); }, [categories]); const onDeletePage = async (categoryId: string, title: string) => { @@ -96,7 +95,7 @@ export default function CategoriesPage() { />