refactor: standardize access token variable naming across routes
This commit is contained in:
@@ -10,7 +10,7 @@ import { contentSchema, type TContentSchema } from '~/pages/form-contents'
|
||||
import type { Route } from './+types/actions.admin.contents.update'
|
||||
|
||||
export const action = async ({ request }: Route.ActionArgs) => {
|
||||
const { staffToken } = await handleCookie(request)
|
||||
const { staffToken: accessToken } = await handleCookie(request)
|
||||
try {
|
||||
const {
|
||||
errors,
|
||||
@@ -26,10 +26,7 @@ export const action = async ({ request }: Route.ActionArgs) => {
|
||||
return data({ success: false, errors, defaultValues }, { status: 400 })
|
||||
}
|
||||
|
||||
const { data: newsData } = await updateNewsRequest({
|
||||
accessToken: staffToken,
|
||||
payload,
|
||||
})
|
||||
const { data: newsData } = await updateNewsRequest({ accessToken, payload })
|
||||
|
||||
return data(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user