refactor: enhance news handling and improve content display in various components

This commit is contained in:
Ardeman
2025-03-09 11:36:47 +08:00
parent bad5294030
commit 4847ef2be3
11 changed files with 161 additions and 26 deletions
@@ -1,14 +1,10 @@
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,
})
export const loader = async ({}: Route.LoaderArgs) => {
const { data: newsData } = await getNews()
return { newsData }
}