diff --git a/security_ejem1/files/image-0.jpg b/security_ejem1/files/image-0.jpg index 5eec0e4..58a4944 100644 Binary files a/security_ejem1/files/image-0.jpg and b/security_ejem1/files/image-0.jpg differ diff --git a/security_ejem1/src/main/java/es/urjc/code/daw/library/team/TeamController.java b/security_ejem1/src/main/java/es/urjc/code/daw/library/team/TeamController.java index 8195668..ba60ba7 100644 --- a/security_ejem1/src/main/java/es/urjc/code/daw/library/team/TeamController.java +++ b/security_ejem1/src/main/java/es/urjc/code/daw/library/team/TeamController.java @@ -18,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonView; import es.urjc.code.daw.library.team.TeamController.TeamListView; +import es.urjc.code.daw.library.user.User; +import es.urjc.code.daw.library.user.UserComponent; import es.urjc.code.daw.library.maatch.Maatch; import es.urjc.code.daw.library.player.Player; import es.urjc.code.daw.library.team.Team; @@ -30,9 +32,14 @@ interface TeamListView extends Team.BasicAtt, Team.PlayersAtt, Team.MaatchAtt, P private static final Logger log = LoggerFactory.getLogger(TeamController.class); + @Autowired + private UserComponent userComponent; + @Autowired private TeamRepository repository; + User loggedUser = userComponent.getLoggedUser(); + @JsonView(TeamListView.class) @RequestMapping(value = "/", method = RequestMethod.GET) public List getTeams() { @@ -69,11 +76,10 @@ public ResponseEntity updateTeam(@PathVariable long id, @RequestBody Team Team team = repository.findOne(id); if (team != null) { - - updatedTeam.setId(id); - repository.save(updatedTeam); - - return new ResponseEntity<>(updatedTeam, HttpStatus.OK); + updatedTeam.setId(id); + repository.save(updatedTeam); + + return new ResponseEntity<>(updatedTeam, HttpStatus.OK); } else { return new ResponseEntity<>(HttpStatus.NOT_FOUND); } diff --git a/security_ejem1/target/classes/META-INF/MANIFEST.MF b/security_ejem1/target/classes/META-INF/MANIFEST.MF index ac0abb3..4b13b6d 100644 --- a/security_ejem1/target/classes/META-INF/MANIFEST.MF +++ b/security_ejem1/target/classes/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Implementation-Title: Probamos Implementation-Version: 0.1.0 -Built-By: ferna_000 +Built-By: Victor Implementation-Vendor-Id: es.sidelab Build-Jdk: 1.8.0_91 Created-By: Maven Integration for Eclipse diff --git a/security_ejem1/target/classes/META-INF/maven/es.sidelab/Probamos/pom.properties b/security_ejem1/target/classes/META-INF/maven/es.sidelab/Probamos/pom.properties index 679105c..7bd4568 100644 --- a/security_ejem1/target/classes/META-INF/maven/es.sidelab/Probamos/pom.properties +++ b/security_ejem1/target/classes/META-INF/maven/es.sidelab/Probamos/pom.properties @@ -1,5 +1,4 @@ #Generated by Maven Integration for Eclipse -#Wed Jun 29 19:46:35 CEST 2016 version=0.1.0 groupId=es.sidelab m2e.projectName=Probamos