From 555de668c83b44679af9ef34f3624a55b372cfce Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Wed, 4 Sep 2024 16:07:38 +0700
Subject: <iman> update new register edit data

---
 src/lib/auth/components/CompanyProfile.jsx | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

(limited to 'src/lib/auth/components/CompanyProfile.jsx')

diff --git a/src/lib/auth/components/CompanyProfile.jsx b/src/lib/auth/components/CompanyProfile.jsx
index 2faede9b..a4c25e40 100644
--- a/src/lib/auth/components/CompanyProfile.jsx
+++ b/src/lib/auth/components/CompanyProfile.jsx
@@ -20,6 +20,7 @@ const CompanyProfile = () => {
       npwp: ''
     }
   })
+  console.log("auth",auth)
 
   const [industries, setIndustries] = useState([])
   useEffect(() => {
@@ -42,11 +43,13 @@ const CompanyProfile = () => {
   useEffect(() => {
     const loadProfile = async () => {
       const dataProfile = await addressApi({ id: auth.parentId })
+      console.log("dataProfile",dataProfile)
       setValue('name', dataProfile.name)
       setValue('industry', dataProfile.industryId)
       setValue('companyType', dataProfile.companyTypeId)
       setValue('taxName', dataProfile.taxName)
       setValue('npwp', dataProfile.npwp)
+      setValue('alamat_wajib_pajak', dataProfile.alamatWajibPajak)
     }
     if (auth) loadProfile()
   }, [auth, setValue])
@@ -54,9 +57,11 @@ const CompanyProfile = () => {
   const onSubmitHandler = async (values) => {
     const data = {
       ...values,
+      id_user:auth.partnerId,
       company_type_id: values.companyType,
       industry_id: values.industry,
-      tax_name: values.taxName
+      tax_name: values.taxName,
+      alamat_lengkap_text:values.alamat_wajib_pajak
     }
     const isUpdated = await odooApi('PUT', `/api/v1/partner/${auth.parentId}`, data)
     if (isUpdated?.id) {
@@ -117,6 +122,9 @@ const CompanyProfile = () => {
             <div>
               <label>Nomor NPWP</label>
               <input {...register('npwp')} type='text' className='form-input mt-3' />
+            </div><div>
+              <label>Alamat Wajib Pajak</label>
+              <input {...register('alamat_wajib_pajak')} type='text' className='form-input mt-3' />
             </div>
           </div>
           <button type='submit' className='btn-yellow w-full mt-6'>
-- 
cgit v1.2.3

