Skip to content

Commit

Permalink
Attempt to resolve unsafe member access and promise error in all-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
LillianHo5 committed May 27, 2024
1 parent f2f5f64 commit cc64f24
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions admin-portal-frontend/src/app/all-page/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -96,7 +95,7 @@ export default function CategoriesPage() {
/>
</div>
<button className="flex flex-row items-center gap-2 px-4 py-2 rounded-md text-white bg-[#00629B]">
{Filter?.src && <img src={Filter.src} alt="Filter" className="w-4 h-4" />}
{Filter ? <img src={Filter.src} alt="Filter" className="w-4 h-4" /> : null}
<p>Filter</p>
</button>
</div>
Expand Down

0 comments on commit cc64f24

Please sign in to comment.