17 lines
562 B
TypeScript
17 lines
562 B
TypeScript
import { getNews } from '~/apis/common/get-news'
|
|
import { handleCookie } from '~/libs/cookies'
|
|
import { ContentsPage } from '~/pages/dashboard-contents'
|
|
|
|
import type { Route } from './+types/_admin.lg-admin._dashboard.contents._index'
|
|
|
|
export const loader = async ({ request }: Route.LoaderArgs) => {
|
|
const { staffToken } = await handleCookie(request)
|
|
const { data: newsData } = await getNews({
|
|
accessToken: staffToken,
|
|
})
|
|
return { newsData }
|
|
}
|
|
|
|
const DashboardContentsIndexLayout = () => <ContentsPage />
|
|
export default DashboardContentsIndexLayout
|