Skip to content

Commit

Permalink
fix(integration): v2 address to correct table
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneD committed Nov 19, 2024
1 parent 8c36ccd commit d4c35f6
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,20 @@ await context.FindAndUpdateParcel(
}, ct);

var previousAddress = await context
.ParcelLatestItemAddresses
.ParcelLatestItemV2Addresses
.FindAsync([message.Message.ParcelId, message.Message.PreviousAddressPersistentLocalId], cancellationToken: ct);

if (previousAddress is not null && previousAddress.Count == 1)
{
context.ParcelLatestItemAddresses.Remove(previousAddress);
context.ParcelLatestItemV2Addresses.Remove(previousAddress);
}
else if (previousAddress is not null)
{
previousAddress.Count -= 1;
}

var newAddress = await context
.ParcelLatestItemAddresses
.ParcelLatestItemV2Addresses
.FindAsync([message.Message.ParcelId, message.Message.NewAddressPersistentLocalId], cancellationToken: ct);

if (newAddress is null || context.Entry(newAddress).State == EntityState.Deleted)
Expand Down Expand Up @@ -250,7 +250,7 @@ private static async Task AddParcelAddress(
CancellationToken ct)
{
var newAddress = await context
.ParcelLatestItemAddresses
.ParcelLatestItemV2Addresses
.FindAsync([parcelId, addressPersistentLocalId], cancellationToken: ct);

if (newAddress is null || context.Entry(newAddress).State == EntityState.Deleted)
Expand Down

0 comments on commit d4c35f6

Please sign in to comment.