Skip to content

Commit

Permalink
Update customer address using invert addresses prop
Browse files Browse the repository at this point in the history
  • Loading branch information
acasazza committed Jul 31, 2024
1 parent ac40e60 commit c40379b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ export function SaveAddressesButton(props: Props): JSX.Element {
setForceDisable(true)
if (order && saveAddresses != null) {
response = await saveAddresses(email)
} else if (createCustomerAddress && billingAddress) {
const address = { ...billingAddress }
} else if (createCustomerAddress) {
const address = invertAddresses ? { ...shippingAddress } : { ...billingAddress }
if (addressId) address.id = addressId
void createCustomerAddress(address as TCustomerAddress)
response = {
Expand Down

0 comments on commit c40379b

Please sign in to comment.