feat: add API endpoints for fetching staff profiles and staff list
This commit is contained in:
@@ -1,15 +1,17 @@
|
||||
import { isRouteErrorResponse } from 'react-router'
|
||||
|
||||
import { getStaffs } from '~/apis/admin/get-staffs'
|
||||
import { handleCookie } from '~/libs/cookies'
|
||||
import { StaffsPage } from '~/pages/dashboard-staffs'
|
||||
|
||||
import type { Route } from './+types/_admin.lg-admin._dashboard.staffs._index'
|
||||
|
||||
// export const loader = async ({ request }: Route.LoaderArgs) => {
|
||||
// const { staffToken: accessToken } = await handleCookie(request)
|
||||
// const { data: usersData } = await getUsers({ accessToken })
|
||||
export const loader = async ({ request }: Route.LoaderArgs) => {
|
||||
const { staffToken: accessToken } = await handleCookie(request)
|
||||
const { data: staffsData } = await getStaffs({ accessToken })
|
||||
|
||||
// return { usersData }
|
||||
// }
|
||||
return { staffsData }
|
||||
}
|
||||
|
||||
export const ErrorBoundary = ({ error }: Route.ErrorBoundaryProps) => {
|
||||
let message = 'Oops!'
|
||||
|
||||
Reference in New Issue
Block a user