Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: display updated customer address on the myAccount address page #1454

Merged
merged 2 commits into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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