cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2-How to update address list (data:elems) in shipping-address/list.html ?

Magento 2-How to update address list (data:elems) in shipping-address/list.html ?

I have added edit link to all the address in shipping step. I am able to update, and the changes are saved in the database but the changes are reflected in the front-end only when the page is reloaded. How to update the address list so that the changes are reflected in the front-end as soon as the update button is clicked .

 updateAddress: function () {
            var addressData,
            newShippingAddress,
            addressId,
            this.source.set('params.invalid', false);
            this.triggerShippingDataValidateEvent();

            if (!this.source.get('params.invalid')) {
                addressData = this.source.get('shippingAddress');
                 addressId=$('input[name=shippingAddressId]').val();
                if(addressId){
                    var Data = {"addressData": addressData, "addressId": addressId};
                    fullScreenLoader.startLoader();
                    storage.post(
                        'checkout/address/update', 
                        JSON.stringify(Data),
                        true
                        ).done(
                        function (response) {
                            console.log(response);
                            console.log("updated");
                            fullScreenLoader.stopLoader();
                            
                        }
                        ).fail(
                        function (response) {
                            console.log("failure");
                            console.log(response);
                            fullScreenLoader.stopLoader();
                        }
                        );
                        this.isFormVisible(false);
                }
        }
    },