summaryrefslogtreecommitdiff
path: root/src/lib/form/components/KunjunganService.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/form/components/KunjunganService.jsx')
-rw-r--r--src/lib/form/components/KunjunganService.jsx10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/form/components/KunjunganService.jsx b/src/lib/form/components/KunjunganService.jsx
index 1cb0b446..0e1d1ab3 100644
--- a/src/lib/form/components/KunjunganService.jsx
+++ b/src/lib/form/components/KunjunganService.jsx
@@ -8,6 +8,9 @@ import { toast } from 'react-hot-toast'
import * as Yup from 'yup'
import createLeadApi from '../api/createLeadApi'
import PageContent from '@/lib/content/components/PageContent'
+import { useRouter } from 'next/router'
+
+import useAuth from '@/core/hooks/useAuth'
const CreateKunjunganService = () => {
const {
@@ -22,10 +25,17 @@ const CreateKunjunganService = () => {
})
const [cities, setCities] = useState([])
const [company_unit, setCompany_unit] = useState([])
+
+ const router = useRouter()
+
+ const auth = useAuth()
const recaptchaRef = useRef(null)
useEffect(() => {
+ if(!auth) {
+ router.push('/login')
+ }
const loadCities = async () => {
let dataCities = await cityApi()
dataCities = dataCities.map((city) => ({ value: city.id, label: city.name }))