diff --git a/src/main/java/at/reisinger/DBConnection.java b/src/main/java/at/reisinger/DBConnection.java index d3b0f8f..24cceef 100644 --- a/src/main/java/at/reisinger/DBConnection.java +++ b/src/main/java/at/reisinger/DBConnection.java @@ -46,6 +46,7 @@ public class DBConnection { * @return true bei erfolg, sonst false */ public boolean updateCardLock(String name, boolean lock){ + System.out.println("Update user_cards set gesperrt = " + lock + " where name = \'" + name + "\';"); return PostgresHelper.executeUpdate("Update user_cards set gesperrt = " + lock + " where name = \'" + name + "\';"); } diff --git a/src/main/java/at/reisinger/server/objects/Response.java b/src/main/java/at/reisinger/server/objects/Response.java index 4e53286..717dd5e 100644 --- a/src/main/java/at/reisinger/server/objects/Response.java +++ b/src/main/java/at/reisinger/server/objects/Response.java @@ -286,17 +286,13 @@ public class Response { if (tradingDeal != null) { String tradingJson = JsonHelper.objToJson(tradingDeal); if (tradingDeal != null) { - //DB Trading deal add - // Lock Card for deck - //Wenn card im deck, dann del aus deck - //new DBConnection().; ArrayList deckCards = new DBConnection().getDeck(username); if (deckCards != null) { if (deckCards.contains(cardtotrade)) { new DBConnection().delDeck(username); } if(new DBConnection().addTradingdeal(tradingDeal.getUsername(), tradingDeal.getId(), tradingDeal.getRequiredMinDamage(), tradingDeal.getRequiredCardType().name(), tradingDeal.getRequiredElementType().name(), tradingDeal.getCardToTrade().getName())){ - if(new DBConnection().updateCardLock(tradingDeal.getUsername(), true)){ + if(new DBConnection().updateCardLock(tradingDeal.getCardToTrade().getName(), true)){ sendResponse(JsonHelper.objToJson(tradingDeal), "201"); }else{ sendError("500");