feat: implement news fetching API and integrate with dashboard contents

This commit is contained in:
Ardeman
2025-03-06 09:30:53 +08:00
parent d27c068f39
commit 703e347830
4 changed files with 81 additions and 17 deletions
@@ -1,4 +1,16 @@
import { getNews } from '~/apis/admin/get-news'
import { handleCookie } from '~/libs/cookies'
import { ContentsPage } from '~/pages/dashboard-contents'
import type { Route } from './+types/_admin.lg-admin._dashboard.contents'
export const loader = async ({ request }: Route.LoaderArgs) => {
const { staffToken } = await handleCookie(request)
const { data: newsData } = await getNews({
accessToken: staffToken,
})
return { newsData }
}
const DashboardContentsLayout = () => <ContentsPage />
export default DashboardContentsLayout