Skip to content

Commit

Permalink
fix: display updated customer address on the myAccount address page (#…
Browse files Browse the repository at this point in the history
…1454)

* save updated customer address in the ngrx store
* clear region on customer address update if necessary
  • Loading branch information
SGrueber authored Jul 5, 2023
1 parent 65c8c9a commit be31fef
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ describe('Addresses Effects', () => {
});

it('should map to action of type updateCustomerSuccess', () => {
const address = { urn: '123' } as Address;
const address = { urn: 'test' } as Address;
const action = updateCustomerAddress({ address });
const completion = updateCustomerAddressSuccess({ address });
const completion2 = displaySuccessMessage({
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/store/customer/addresses/addresses.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class AddressesEffects {
filter(([address, customer]) => !!address || !!customer),
mergeMap(([address]) =>
this.addressService.updateCustomerAddress('-', address).pipe(
mergeMap(() => [
mergeMap(address => [
updateCustomerAddressSuccess({ address }),
displaySuccessMessage({ message: 'account.addresses.address_updated.message' }),
]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class FormlyCustomerAddressFormComponent implements OnInit, OnChanges {
let formAddress: Address = this.form.value.address;
if (this.address) {
// update form values in the original address
formAddress = { ...this.address, ...formAddress };
formAddress = { ...this.address, mainDivisionCode: '', ...formAddress };
}
if (this.extension) {
formAddress = { ...formAddress, email: this.extensionForm.get('email')?.value };
Expand Down

0 comments on commit be31fef

Please sign in to comment.