mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
Adjusted
This commit is contained in:
@@ -1,17 +1,10 @@
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { useAuth } from '@/contexts/AuthContext'
|
||||
|
||||
export default function NotFound() {
|
||||
const { user } = useAuth()
|
||||
const navigate = useNavigate()
|
||||
|
||||
const goHome = () => {
|
||||
switch (user?.acc_type) {
|
||||
case 'admin': navigate('/admin'); break
|
||||
case 'client': navigate('/client'); break
|
||||
case 'staff': navigate('/staff'); break
|
||||
default: navigate(-1)
|
||||
}
|
||||
navigate(-1)
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,17 +1,10 @@
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { useAuth } from '@/contexts/AuthContext'
|
||||
|
||||
export default function Unauthorized() {
|
||||
const { user } = useAuth()
|
||||
const navigate = useNavigate()
|
||||
|
||||
const goHome = () => {
|
||||
switch (user?.acc_type) {
|
||||
case 'admin': navigate('/admin'); break
|
||||
case 'client': navigate('/client'); break
|
||||
case 'staff': navigate('/staff'); break
|
||||
default: navigate(-1)
|
||||
}
|
||||
navigate(-1)
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user