feat: add dashboard categories page with data table and loader
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
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
|
||||
Reference in New Issue
Block a user