From 6657f184294c24b40a3739aa4aee7dd01b912ff1 Mon Sep 17 00:00:00 2001 From: LillianHo5 Date: Mon, 27 May 2024 15:45:09 -0700 Subject: [PATCH] Resolve unnecessary assertion error --- admin-portal-frontend/src/app/all-page/page.tsx | 2 +- admin-portal-frontend/src/app/emergencies/page.tsx | 2 +- admin-portal-frontend/src/app/general-principles/page.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/admin-portal-frontend/src/app/all-page/page.tsx b/admin-portal-frontend/src/app/all-page/page.tsx index c6c2e9b..ce3b72e 100644 --- a/admin-portal-frontend/src/app/all-page/page.tsx +++ b/admin-portal-frontend/src/app/all-page/page.tsx @@ -20,7 +20,7 @@ export default function CategoriesPage() { useEffect(() => { const fetchData = async () => { try { - const fetchedCategories = (await getAllCategories()) as Category[]; + const fetchedCategories = await getAllCategories(); setCategories(fetchedCategories as never); } catch (error) { console.log("Fetch categories failed."); diff --git a/admin-portal-frontend/src/app/emergencies/page.tsx b/admin-portal-frontend/src/app/emergencies/page.tsx index 8bd7cd6..b03217d 100644 --- a/admin-portal-frontend/src/app/emergencies/page.tsx +++ b/admin-portal-frontend/src/app/emergencies/page.tsx @@ -13,7 +13,7 @@ export default function CategoriesPage() { useEffect(() => { const fetchData = async () => { try { - const fetchedCategories = (await getAllCategories()) as Category[]; + const fetchedCategories = await getAllCategories(); setCategories(fetchedCategories as never); } catch (error) { console.log("Fetch categories failed."); diff --git a/admin-portal-frontend/src/app/general-principles/page.tsx b/admin-portal-frontend/src/app/general-principles/page.tsx index 88b6908..5f27ba5 100644 --- a/admin-portal-frontend/src/app/general-principles/page.tsx +++ b/admin-portal-frontend/src/app/general-principles/page.tsx @@ -13,7 +13,7 @@ export default function CategoriesPage() { useEffect(() => { const fetchData = async () => { try { - const fetchedCategories = (await getAllCategories()) as Category[]; + const fetchedCategories = await getAllCategories(); setCategories(fetchedCategories as never); } catch (error) { console.log("Fetch categories failed.");