2025-03-06 09:30:53 +08:00
|
|
|
import { getNews } from '~/apis/admin/get-news'
|
|
|
|
|
import { handleCookie } from '~/libs/cookies'
|
2025-02-25 15:45:27 +07:00
|
|
|
import { ContentsPage } from '~/pages/dashboard-contents'
|
|
|
|
|
|
2025-03-07 12:11:48 +08:00
|
|
|
import type { Route } from './+types/_admin.lg-admin._dashboard.contents._index'
|
2025-03-06 09:30:53 +08:00
|
|
|
|
|
|
|
|
export const loader = async ({ request }: Route.LoaderArgs) => {
|
|
|
|
|
const { staffToken } = await handleCookie(request)
|
|
|
|
|
const { data: newsData } = await getNews({
|
|
|
|
|
accessToken: staffToken,
|
|
|
|
|
})
|
|
|
|
|
return { newsData }
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-07 12:11:48 +08:00
|
|
|
const DashboardContentsIndexLayout = () => <ContentsPage />
|
|
|
|
|
export default DashboardContentsIndexLayout
|