Changed getTeamInvite fro better readibility (Worng folder)
This commit is contained in:
parent
4cdadc8f7b
commit
fc5d644ec5
@ -7,7 +7,7 @@ plugins {
|
||||
apply plugin: 'io.spring.dependency-management'
|
||||
apply plugin: 'idea'
|
||||
apply plugin: 'com.moowork.node'
|
||||
//apply plugin: 'war'
|
||||
apply plugin: 'war'
|
||||
|
||||
group = 'de.hhn.labsw'
|
||||
version = '0.0.1-SNAPSHOT'
|
||||
@ -23,6 +23,7 @@ dependencies {
|
||||
runtimeOnly 'org.springframework.boot:spring-boot-devtools'
|
||||
runtimeOnly 'mysql:mysql-connector-java'
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||
compile 'org.springframework.boot:spring-boot-starter-web'
|
||||
|
||||
//JPA
|
||||
compile 'org.springframework.boot:spring-boot-starter-data-jpa'
|
||||
@ -40,14 +41,14 @@ dependencies {
|
||||
|
||||
compile 'org.springframework.boot:spring-boot-starter-tomcat'
|
||||
//compile 'org.springframework.boot:spring-boot-starter-security'
|
||||
compile 'org.springframework.boot:spring-boot-starter-actuator'
|
||||
//compile 'org.springframework.boot:spring-boot-starter-actuator'
|
||||
//compile 'org.springframework.boot:spring-boot-starter-aop'
|
||||
//ompile group: 'org.springframework.boot', name: 'spring-boot-starter-mail', version: '1.2.0.RELEASE'
|
||||
|
||||
compile group: 'org.springframework.security', name: 'spring-security-core', version: '5.1.4.RELEASE'
|
||||
//compile group: 'at.favre.lib', name: 'bcrypt', version: '{latest-version}'
|
||||
|
||||
//providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
|
||||
providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
|
||||
|
||||
//JWT
|
||||
compile 'io.jsonwebtoken:jjwt-api:0.10.5'
|
||||
|
||||
@ -784,13 +784,20 @@ public class Controller {
|
||||
|
||||
User user = (User) getUser.getBody();
|
||||
|
||||
List<TeamInvite> teamInvitesList = new ArrayList<>();
|
||||
List<TeamInvite> teamInvitesList = teamInviteRepository.findByUser(user);
|
||||
|
||||
for (TeamInvite teamInvite : teamInviteRepository.findAll()) {
|
||||
for (TeamInvite tmp : teamInvitesList){
|
||||
tmp.setUser(null);
|
||||
}
|
||||
|
||||
/*for (TeamInvite teamInvite : teamInviteRepository.findAll()) {
|
||||
if (teamInvite.getUser() == user) {
|
||||
teamInvitesList.add(teamInvite);
|
||||
}
|
||||
}
|
||||
}+/
|
||||
|
||||
|
||||
*/
|
||||
|
||||
return ResponseEntity.status(200).body(new Gson().toJson(teamInvitesList));
|
||||
}
|
||||
|
||||
@ -6,6 +6,9 @@ import hhn.labsw.bugageocaching.entities.TeamInvite;
|
||||
import hhn.labsw.bugageocaching.entities.User;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TeamInviteRepository extends JpaRepository<TeamInvite, Integer> {
|
||||
TeamInvite findByUserAndTeam(User user, Team team);
|
||||
List<TeamInvite> findByUser(User user);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user