diff --git a/src/main/java/at/reisinger/server/objects/Response.java b/src/main/java/at/reisinger/server/objects/Response.java index b99c93e..4e53286 100644 --- a/src/main/java/at/reisinger/server/objects/Response.java +++ b/src/main/java/at/reisinger/server/objects/Response.java @@ -129,6 +129,20 @@ public class Response { } else { sendError("500"); } + }else if(this.url.startsWith("/tradings")) { + ArrayList allDeals = new DBConnection().getAllTradingDeals(); + if(allDeals != null && !allDeals.isEmpty()){ + String json = JsonHelper.objToJson(allDeals); + if(json != null && json != ""){ + sendResponse(json, "200"); + }else{ + sendError("500"); + } + }else{ + sendError("500"); + } + }else{ + sendError("204"); } }