fix: update category selection logic to use code instead of id
This commit is contained in:
parent
e2e3095c33
commit
05b3af8718
@ -6,7 +6,7 @@ import type { Route } from './+types/_news.category.$code'
|
|||||||
export const loader = async ({ params }: Route.LoaderArgs) => {
|
export const loader = async ({ params }: Route.LoaderArgs) => {
|
||||||
const { data: categoriesData } = await getCategories()
|
const { data: categoriesData } = await getCategories()
|
||||||
const categoryData = categoriesData.find(
|
const categoryData = categoriesData.find(
|
||||||
(category) => category.id === params.id,
|
(category) => category.code === params.code,
|
||||||
)
|
)
|
||||||
return { categoryData }
|
return { categoryData }
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user