fix user id getter in completeCheckout
This commit is contained in:
@@ -246,7 +246,7 @@ public class CartService {
|
|||||||
Cart cart = cartRepository.findById(cartId)
|
Cart cart = cartRepository.findById(cartId)
|
||||||
.orElseThrow(() -> new BusinessException("Cart not found"));
|
.orElseThrow(() -> new BusinessException("Cart not found"));
|
||||||
|
|
||||||
if (!cart.getUser().getUserId().equals(userId)) {
|
if (!cart.getUser().getId().equals(userId)) {
|
||||||
throw new BusinessException("Unauthorized");
|
throw new BusinessException("Unauthorized");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user