update allow user to edit billing address

This commit is contained in:
edmondlang
2023-03-02 22:20:08 +08:00
parent 1e6ac000ac
commit 579dd02ebf
@@ -70,7 +70,7 @@ class CreateBillingAddressLogic extends AbstractControllerLogic
$address = $this->fetchesAddress->execute(['id' => $request->input('billing_address_id')]);
if ($address->type !== AddressType::BILLING || $address !== $companyModule->addresses->where('type', AddressType::BILLING)->first()) {
if ($address->type !== AddressType::BILLING || $address->id !== $companyModule->addresses->where('type', AddressType::BILLING)->first()->id) {
// delete all current billing address
Address::where('owner_type', CompanyModule::class)->where('owner_id', $request->input('company_module_id'))->where('type', AddressType::BILLING)->delete();