Skip to content

Commit

Permalink
add @transactional to createCart method
Browse files Browse the repository at this point in the history
  • Loading branch information
naruepracht-s committed Mar 24, 2024
1 parent 7a9c6aa commit b9241cf
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.kampus.kbazaar.promotion.PromotionRepository;
import com.kampus.kbazaar.shopper.Shopper;
import com.kampus.kbazaar.shopper.ShopperRepository;
import jakarta.transaction.Transactional;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -64,6 +65,7 @@ public ApplyCodeResponse applyCode(String username, ApplyCodeRequest request) {
}
}

@Transactional
public CreateCartResponse createCart(String userName, CartRequest cartRequest) {
CreateCartResponse response = new CreateCartResponse();
Optional<Shopper> shopper = shopperRepository.findByUsername(userName);
Expand Down

0 comments on commit b9241cf

Please sign in to comment.