refactor: standardize access token variable naming across routes
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user