Commit 98245fb2 authored by keita.onoguchi's avatar keita.onoguchi

Merge branch '調整' into 'master'

追加

See merge request !72
parents 97fceecc 2b5bc1b2
......@@ -124,6 +124,10 @@ public class EcsiteRestController {
LinkedHashMap<String, Items> cart = new LinkedHashMap<String, Items>();
String id = data.getShoesId().toString();
//生成したHashMapにセッションにもともとある情報を照会させる。
shoes = shoesService.findOne(data.getShoesId());
if(shoes.getStock() < data.getQuantity()){
throw new BadRequestException();
}
cart = (LinkedHashMap<String, Items>) session.getAttribute("cart");
if(data.getQuantity() == 0) {
cart.remove(id);
......
......@@ -60,7 +60,10 @@ $('.itemCountChange').on('click', function(event){
})
.done(function(){
window.location.href = "/limited/cart";
});
})
.fail(function(){
alert("数量が在庫数を超えています。");
})
//[#modal-content]と[#modal-overlay]をフェードアウトした後に…
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment