summaryrefslogtreecommitdiff
path: root/src-migrate/modules
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-10-01 09:42:51 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-10-01 09:42:51 +0700
commited679c9b8ea85e8f181cf67465effc4b5ff1a7bc (patch)
tree5b73053206184701c05b33e98a420e748e2686d8 /src-migrate/modules
parentdbc533f88854555af8f1ba031b1640836c903183 (diff)
<iman> update code has npwp atau sppkp
Diffstat (limited to 'src-migrate/modules')
-rw-r--r--src-migrate/modules/register/components/FormBisnis.tsx17
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', ' ');
}
});
}