refactor: standardize access token variable naming across routes

This commit is contained in:
Ardeman
2025-03-12 20:46:54 +08:00
parent f423f3e1c0
commit 1ce5a2130b
22 changed files with 127 additions and 94 deletions
+3 -5
View File
@@ -10,11 +10,9 @@ import { NewsDetailPage } from '~/pages/news-detail'
import type { Route } from './+types/_news.detail.$slug'
export const loader = async ({ request, params }: Route.LoaderArgs) => {
const { userToken } = await handleCookie(request)
const { data: newsDetailData } = await getNewsBySlug({
slug: params.slug,
accessToken: userToken,
})
const { userToken: accessToken } = await handleCookie(request)
const { slug } = params
const { data: newsDetailData } = await getNewsBySlug({ slug, accessToken })
const { data: categoriesData } = await getCategories()
const beritaCode = 'berita'
const beritaCategory = categoriesData.find(