summaryrefslogtreecommitdiff
path: root/src/lib/form/components/KunjunganService.jsx
diff options
context:
space:
mode:
authorHATEC\SPVDEV001 <tri.susilo@altama.co.id>2024-01-30 09:03:20 +0700
committerHATEC\SPVDEV001 <tri.susilo@altama.co.id>2024-01-30 09:03:20 +0700
commitf7701abcbe05510c3672c4768df03fee535956e3 (patch)
tree29cf4ff30aae1798ea32c6a635dc59441073e4e3 /src/lib/form/components/KunjunganService.jsx
parentceb2f3ef22b87378727aa8174d9e41952b72ee36 (diff)
handling form form
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 }))