summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-10-01 11:13:59 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-10-01 11:13:59 +0700
commit693645910dab9e3f36600c9c542249455c1e1369 (patch)
treeb83b553feea402531ce7e0b3457f952a346e5e0f
parent2dc7f7ae3eb62f9821f8ae1fb87db2e7b9234e1b (diff)
parente5a5e1d5a7392871e3394ea2f629645195be5776 (diff)
Merge branch 'new-release' into Feature/switch-account
-rw-r--r--src-migrate/pages/shop/cart/cart.module.css2
-rw-r--r--src/lib/address/components/EditAddress.jsx37
2 files changed, 19 insertions, 20 deletions
diff --git a/src-migrate/pages/shop/cart/cart.module.css b/src-migrate/pages/shop/cart/cart.module.css
index 806104be..b756fb15 100644
--- a/src-migrate/pages/shop/cart/cart.module.css
+++ b/src-migrate/pages/shop/cart/cart.module.css
@@ -19,7 +19,7 @@
}
.summary-wrapper {
- @apply w-full md:w-1/4 md:pl-6 mt-6 md:mt-0 bottom-0 md:sticky sticky bg-white;
+ @apply w-[85%] md:w-1/4 md:pl-6 mt-6 md:mt-0 bottom-8 md:sticky fixed bg-white;
}
.summary {
diff --git a/src/lib/address/components/EditAddress.jsx b/src/lib/address/components/EditAddress.jsx
index ff6b1f12..182c8a31 100644
--- a/src/lib/address/components/EditAddress.jsx
+++ b/src/lib/address/components/EditAddress.jsx
@@ -45,7 +45,7 @@ const EditAddress = ({ id, defaultValues }) => {
setValue('business_name', dataProfile.name);
};
if (auth) loadProfile();
- }, [auth, setValue]);
+ }, [auth?.parentId]);
useEffect(() => {
const loadCities = async () => {
@@ -111,30 +111,29 @@ const EditAddress = ({ id, defaultValues }) => {
district_id: values.district,
sub_district_id: values.subDistrict,
};
+ if (!auth.company) {
+ data.alamat_lengkap_text = values.street;
+ }
const address = await editAddressApi({ id, data });
let dataAlamat;
let isUpdated = true;
- if (auth?.partnerId == id) {
- dataAlamat = {
- id_user: auth.partnerId,
- company_type_id: values.companyType,
- industry_id: values.industry,
- tax_name: values.taxName,
- alamat_lengkap_text: values.alamat_wajib_pajak,
- street: values.street,
- business_name: values.business_name,
- name: values.business_name,
- npwp: values.npwp,
- };
- isUpdated = await odooApi(
- 'PUT',
- `/api/v1/partner/${auth.parentId}`,
- dataAlamat
- );
+ if (auth.company) {
+ if (auth?.partnerId == id) {
+ dataAlamat = {
+ id_user: auth.partnerId,
+ alamat_lengkap_text: values.alamat_wajib_pajak,
+ street: values.street,
+ };
+ isUpdated = await odooApi(
+ 'PUT',
+ `/api/v1/partner/${auth.parentId}`,
+ dataAlamat
+ );
+ }
}
// if (isUpdated?.id) {
- if (address?.id && isUpdated?.id) {
+ if (address?.id && auth.company ? isUpdated?.id : true) {
toast.success('Berhasil mengubah alamat');
router.back();
} else {