diff options
Diffstat (limited to 'src-migrate/modules')
| -rw-r--r-- | src-migrate/modules/register/components/FormBisnis.tsx | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src-migrate/modules/register/components/FormBisnis.tsx b/src-migrate/modules/register/components/FormBisnis.tsx index 16747ff3..9e5a0c07 100644 --- a/src-migrate/modules/register/components/FormBisnis.tsx +++ b/src-migrate/modules/register/components/FormBisnis.tsx @@ -351,9 +351,11 @@ const form: React.FC<FormProps> = ({ useEffect(() => { const checkUrlNPWP = async (url: string | URL | Request) => { try { - const response = `${process.env.NEXT_PUBLIC_ODOO_API_HOST}/api/v1/user/chek/npwp/${auth?.parentId}`; - - return response; // Returns true if status is 200-299 + const response = await odooApi( + 'GET', + `/api/v1/user/chek/npwp/${auth?.parentId}` + ); + return response.status; // Returns true if status is 200-299 } catch (error) { console.error('Error accessing URL:', url, error); return false; @@ -361,9 +363,12 @@ const form: React.FC<FormProps> = ({ }; const checkUrlSPPKP = async (url: string | URL | Request) => { try { - const response = `${process.env.NEXT_PUBLIC_ODOO_API_HOST}/api/v1/user/chek/sppkp/${auth?.parentId}`; + const response = await odooApi( + 'GET', + `/api/v1/user/chek/sppkp/${auth?.parentId}` + ); - return response; // Returns true if status is 200-299 + return response.status; // Returns true if status is 200-299 } catch (error) { console.error('Error accessing URL:', url, error); return false; @@ -379,7 +384,6 @@ const form: React.FC<FormProps> = ({ setFileUrl(npwpUrl); setHasNpwp(true); updateForm('npwp_document', ' '); - updateForm('sppkp_document', ' '); } }); @@ -387,6 +391,7 @@ const form: React.FC<FormProps> = ({ if (isAccessible) { setFileUrlSppkp(sppkpUrl); setHasSPPKP(true); + updateForm('sppkp_document', ' '); } }); } |
