Commit 9ab0ae82 authored by keita.onoguchi's avatar keita.onoguchi

調整途中

parent 77ae3237
...@@ -8,4 +8,5 @@ import com.example.domain.Wallets; ...@@ -8,4 +8,5 @@ import com.example.domain.Wallets;
//ウォレット情報をDBから取得 //ウォレット情報をDBから取得
@Repository @Repository
public interface WalletsRepository extends JpaRepository<Wallets, Integer> { public interface WalletsRepository extends JpaRepository<Wallets, Integer> {
public Wallets findByUserId(Integer id);
} }
...@@ -19,7 +19,7 @@ public class WalletsService { ...@@ -19,7 +19,7 @@ public class WalletsService {
} }
public Wallets findOne(Integer id){ public Wallets findOne(Integer id){
return walletsRepository.findOne(id); return walletsRepository.findByUserId(id);
} }
public Wallets create(Wallets wallet){ public Wallets create(Wallets wallet){
......
...@@ -38,6 +38,7 @@ $('#ok-btn').on('click',function(){ ...@@ -38,6 +38,7 @@ $('#ok-btn').on('click',function(){
}) })
.fail(function(){ .fail(function(){
alert("ウォレットの残高が足りません。チャージしてください"); alert("ウォレットの残高が足りません。チャージしてください");
window.location.href = ($('#wallets').attr('href'));
}) })
}); });
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<li><a th:href="@{/limited/top}">Home</a></li> <li><a th:href="@{/limited/top}">Home</a></li>
<li><a th:href="@{/limited/list}">Shop</a></li> <li><a th:href="@{/limited/list}">Shop</a></li>
<li><a th:href="@{/limited/log/{id}(id=${user.id})}">My Purchase Log</a></li> <li><a th:href="@{/limited/log/{id}(id=${user.id})}">My Purchase Log</a></li>
<li><a th:href="@{/limited/wallets/{id}(id=${user.id})}">Wallets</a></li> <li><a id="wallets" th:href="@{/limited/wallets/{id}(id=${user.id})}">Wallets</a></li>
</ul> </ul>
<ul class="nav navbar-nav navbar-right cart-menu"> <ul class="nav navbar-nav navbar-right cart-menu">
<li><a class="search-btn"><i class="fa fa-search" aria-hidden="true"></i></a></li> <li><a class="search-btn"><i class="fa fa-search" aria-hidden="true"></i></a></li>
......
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