16 lines
593 B
TypeScript
16 lines
593 B
TypeScript
|
|
import { getCategories } from '~/apis/common/get-categories'
|
||
|
|
import { handleCookie } from '~/libs/cookies'
|
||
|
|
import { CategoriesPage } from '~/pages/dashboard-categories'
|
||
|
|
|
||
|
|
import type { Route } from './+types/_admin.lg-admin._dashboard.categories._index'
|
||
|
|
|
||
|
|
export const loader = async ({ request }: Route.LoaderArgs) => {
|
||
|
|
const { staffToken } = await handleCookie(request)
|
||
|
|
const { data: dataCategories } = await getCategories({
|
||
|
|
accessToken: staffToken,
|
||
|
|
})
|
||
|
|
return { dataCategories }
|
||
|
|
}
|
||
|
|
const DashboardCategoriesLayout = () => <CategoriesPage />
|
||
|
|
export default DashboardCategoriesLayout
|