Skip to content

Commit

Permalink
Mergeo con rama jorge
Browse files Browse the repository at this point in the history
  • Loading branch information
Avadem committed Feb 23, 2020
1 parent 1f28461 commit 207b45d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions practica/src/main/java/com/practica/demo/WebController.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@
import org.springframework.security.web.server.csrf.CsrfToken;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.practica.demo.data.Games;
import com.practica.demo.data.user.UserRepository;
import com.practica.demo.data.user.User;
Expand Down Expand Up @@ -89,8 +92,8 @@ public String goLeaderBoard(Model model) {

@GetMapping("/profile")
public String goProfile(Model model, @RequestParam(required = false) int id) {

Optional<User> usuario = repositoruUser.findById(id);
Optional<User> usuario = userRepository.findById(Integer.toString(id));

if(userComponent.getLoggedUser().getIduser()==usuario.get().getIduser()) {
model.addAttribute("myprofile", true);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.practica.demo.data.user;

import java.util.Optional;

import org.springframework.data.repository.CrudRepository;


Expand All @@ -10,4 +12,5 @@ public interface UserRepository extends CrudRepository<User, String> {

User findByemail(String email);


}

0 comments on commit 207b45d

Please sign in to comment.