From 5c9b85e577e5ef7e9b516899ffd292d45e54f59a Mon Sep 17 00:00:00 2001 From: Maximilian Leopold Date: Thu, 9 May 2019 13:46:11 +0200 Subject: [PATCH] Adde Teammembers fixed --- aaa.html | 20 ------------------- .../bugageocaching/controller/Controller.java | 1 - .../repositories/TeamRepository.java | 8 ++------ .../labsw/bugageocaching/util/FinderUtil.java | 3 ++- 4 files changed, 4 insertions(+), 28 deletions(-) delete mode 100644 aaa.html diff --git a/aaa.html b/aaa.html deleted file mode 100644 index aa143ea..0000000 --- a/aaa.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - BuGa Lageplan - - - - - - - - - - -
- - - \ No newline at end of file diff --git a/src/main/java/hhn/labsw/bugageocaching/controller/Controller.java b/src/main/java/hhn/labsw/bugageocaching/controller/Controller.java index 9b6ae81..9b5b4d8 100644 --- a/src/main/java/hhn/labsw/bugageocaching/controller/Controller.java +++ b/src/main/java/hhn/labsw/bugageocaching/controller/Controller.java @@ -1,7 +1,6 @@ package hhn.labsw.bugageocaching.controller; import com.google.gson.Gson; -import com.mashape.unirest.http.exceptions.UnirestException; import hhn.labsw.bugageocaching.entities.*; import hhn.labsw.bugageocaching.helper.POI; import hhn.labsw.bugageocaching.helper.RankingListHelper; diff --git a/src/main/java/hhn/labsw/bugageocaching/repositories/TeamRepository.java b/src/main/java/hhn/labsw/bugageocaching/repositories/TeamRepository.java index 9390a7c..608ede6 100644 --- a/src/main/java/hhn/labsw/bugageocaching/repositories/TeamRepository.java +++ b/src/main/java/hhn/labsw/bugageocaching/repositories/TeamRepository.java @@ -14,14 +14,10 @@ public interface TeamRepository extends JpaRepository { @Query(value = "SELECT *\n" + "FROM user\n" + - "WHERE id = (\n" + + "WHERE id IN (\n" + " SELECT user_id\n" + " FROM user_info\n" + - " WHERE team_id = (SELECT team_id\n" + - " FROM team\n" + - " WHERE name = ?1\n" + - " )\n" + - ")", nativeQuery = true) + " WHERE team_id = (SELECT team_id FROM team WHERE name = ?1))", nativeQuery = true) List getTeammembers(String name); diff --git a/src/main/java/hhn/labsw/bugageocaching/util/FinderUtil.java b/src/main/java/hhn/labsw/bugageocaching/util/FinderUtil.java index 4fc883c..55cbf2c 100644 --- a/src/main/java/hhn/labsw/bugageocaching/util/FinderUtil.java +++ b/src/main/java/hhn/labsw/bugageocaching/util/FinderUtil.java @@ -184,7 +184,8 @@ public class FinderUtil { sendBack.add(tmp); } - return ResponseEntity.status(200).body(sendBack); + + return ResponseEntity.status(200).body(list); } else { return ResponseEntity.status(404).body("Couldnt find Team member of Team " + name); }