refactor: update user address models and methods to use CustomerAddressModel across multiple components
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 3m8s
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 3m8s
This commit is contained in:
@@ -71,7 +71,7 @@ public class CartService
|
||||
{
|
||||
if (existing is null)
|
||||
{
|
||||
await _client.AddNewUserCartAsync(new AddNewUserCartRequest
|
||||
await _client.AddNewUserCartForCustomerAsync(new AddNewUserCartForCustomerRequest
|
||||
{
|
||||
ProductId = product.Id,
|
||||
Count = newQuantity
|
||||
@@ -80,10 +80,9 @@ public class CartService
|
||||
}
|
||||
else
|
||||
{
|
||||
await _client.UpdateUserCartAsync(new UpdateUserCartRequest
|
||||
await _client.UpdateUserCartForCustomerAsync(new UpdateUserCartForCustomerRequest
|
||||
{
|
||||
UserCartId = existing.cartId,
|
||||
|
||||
CartItemId = existing.cartId,
|
||||
Count = newQuantity
|
||||
});
|
||||
}
|
||||
@@ -112,9 +111,9 @@ public class CartService
|
||||
|
||||
try
|
||||
{
|
||||
await _client.UpdateUserCartAsync(new UpdateUserCartRequest
|
||||
await _client.UpdateUserCartForCustomerAsync(new UpdateUserCartForCustomerRequest
|
||||
{
|
||||
UserCartId = existing.cartId,
|
||||
CartItemId = existing.cartId,
|
||||
Count = quantity
|
||||
});
|
||||
}
|
||||
@@ -134,11 +133,10 @@ public class CartService
|
||||
|
||||
try
|
||||
{
|
||||
// Interpret Count=0 as remove from cart
|
||||
await _client.UpdateUserCartAsync(new UpdateUserCartRequest
|
||||
// Use dedicated remove endpoint
|
||||
await _client.RemoveUserCartForCustomerAsync(new RemoveUserCartForCustomerRequest
|
||||
{
|
||||
UserCartId = cartId,
|
||||
Count = 0
|
||||
CartItemId = cartId
|
||||
});
|
||||
}
|
||||
catch
|
||||
@@ -158,12 +156,11 @@ public class CartService
|
||||
|
||||
try
|
||||
{
|
||||
foreach (var id in productIds)
|
||||
foreach (var item in productIds)
|
||||
{
|
||||
await _client.UpdateUserCartAsync(new UpdateUserCartRequest
|
||||
await _client.RemoveUserCartForCustomerAsync(new RemoveUserCartForCustomerRequest
|
||||
{
|
||||
UserCartId = id,
|
||||
Count = 0
|
||||
CartItemId = item
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user