From 05b3af87180627f904aa86c3f5194befa2b36773 Mon Sep 17 00:00:00 2001 From: Ardeman Date: Sun, 9 Mar 2025 09:50:18 +0800 Subject: [PATCH] fix: update category selection logic to use code instead of id --- app/routes/_news.category.$code.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/routes/_news.category.$code.tsx b/app/routes/_news.category.$code.tsx index 6fbfef0..1071fb2 100644 --- a/app/routes/_news.category.$code.tsx +++ b/app/routes/_news.category.$code.tsx @@ -6,7 +6,7 @@ import type { Route } from './+types/_news.category.$code' export const loader = async ({ params }: Route.LoaderArgs) => { const { data: categoriesData } = await getCategories() const categoryData = categoriesData.find( - (category) => category.id === params.id, + (category) => category.code === params.code, ) return { categoryData } }