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
@@ -7,11 +7,9 @@ import { FormContentsPage } from '~/pages/form-contents'
import type { Route } from './+types/_admin.lg-admin._dashboard.contents.update.$slug'
export const loader = async ({ request, params }: Route.LoaderArgs) => {
const { staffToken } = await handleCookie(request)
const { data: newsData } = await getNewsBySlug({
accessToken: staffToken,
slug: params.slug,
})
const { staffToken: accessToken } = await handleCookie(request)
const { slug } = params
const { data: newsData } = await getNewsBySlug({ accessToken, slug })
return { newsData }
}