Note that this is an HTTP PUT request:
/occ/v2/electronics-spa/users/current/carts/00008679/addresses/delivery?addressId=8796483878935&lang=en&curr=USD
Where did this address id 8796483878935 come from? There is an introduction in my article SAP Spartacus shipping address page Request 1-Address .
给cart设置delivery address?
/addresses/delivery?addressId=8796483878935&lang=en&curr=USD
Search items according to the keyword addresses/delivery:
Why does the action dispatch of Load user address trigger the HTTP put operation of set address?
In the scan code, where will CheckoutActions.SET_DELIVERY_ADDRESS be sent
Then check which code dispatched this Action class: SetDeliveryAddress
Still in shipping-address.component.ts:
This is the trigger point of all address operation logic:
Why does the function in return respond to store.dispatch(new UserActions.LoadUserAddress)?
The following figure highlights two lines of code for clues:
For more original articles by Jerry, please follow the public account "Wang Zixi":