summaryrefslogtreecommitdiff
path: root/src/lib/auth/components
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-09-04 16:07:38 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-09-04 16:07:38 +0700
commit555de668c83b44679af9ef34f3624a55b372cfce (patch)
tree8048d745a8ffba5540706e5de1267aeece0b7dbb /src/lib/auth/components
parenta19531237842b27cfa2d62b32543bbdbca454bc2 (diff)
<iman> update new register edit data
Diffstat (limited to 'src/lib/auth/components')
-rw-r--r--src/lib/auth/components/CompanyProfile.jsx10
1 files changed, 9 insertions, 1 deletions
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'>