diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/form/components/Merchant.jsx | 2 | ||||
| -rw-r--r-- | src/pages/daftar-merchant.jsx | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/lib/form/components/Merchant.jsx b/src/lib/form/components/Merchant.jsx index adb34671..742c994d 100644 --- a/src/lib/form/components/Merchant.jsx +++ b/src/lib/form/components/Merchant.jsx @@ -297,8 +297,6 @@ const CreateMerchant = () => { values.address + ' \r\n Kota : ' + values.city + - ' \r\n Unit Perusahaan : ' + - values.company_unit + ' \r\n Telepon: ' + values.phone + ' \r\n Email : ' + diff --git a/src/pages/daftar-merchant.jsx b/src/pages/daftar-merchant.jsx index c224ed0d..8616cc46 100644 --- a/src/pages/daftar-merchant.jsx +++ b/src/pages/daftar-merchant.jsx @@ -7,12 +7,22 @@ import { useRouter } from 'next/router'; export default function DaftarMerchant() { const router = useRouter(); const auth = useAuth(); + if (auth == false) { + router.push(`/login?next=${encodeURIComponent('/daftar-merchant')}`); + } + if (!auth) { + return; + } return ( <> <Seo title='Daftar Merchant - Indoteknik.com' /> <BasicLayout> - {auth?.company ? <CreateMerchant></CreateMerchant> : <ErrorMerchant />} + {auth && auth?.company ? ( + <CreateMerchant></CreateMerchant> + ) : ( + <ErrorMerchant /> + )} </BasicLayout> </> ); |
