Skip to content

Commit

Permalink
fix: use customer address in address reference
Browse files Browse the repository at this point in the history
  • Loading branch information
malessani committed Feb 19, 2024
1 parent df76f9c commit 4e23a90
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/data/AppProvider/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ export async function checkAndSetDefaultAddressForOrder({

// Set reference on original address if not present
// doing this we can lookup the cloned address for the same entity
if (address.id && address.reference !== address.id) {
if (address.id && address.reference !== customerAddresses[0].id) {
await cl.addresses.update({
id: address.id,
reference: address.id,
reference: customerAddresses[0].id,
})
}

Expand Down Expand Up @@ -186,7 +186,7 @@ export async function checkAndSetDefaultAddressForOrder({
customerAddresses: [
{
...customerAddresses[0],
address: { ...address, reference: address.id },
address: { ...address, reference: customerAddresses[0].id },
},
],
hasSameAddresses: true,
Expand Down

0 comments on commit 4e23a90

Please sign in to comment.