diff --git a/src/main/java/fi/pizzalovers/blogbackend/MyRestController.java b/src/main/java/fi/pizzalovers/blogbackend/MyRestController.java index 2c1311b..d2e13c7 100644 --- a/src/main/java/fi/pizzalovers/blogbackend/MyRestController.java +++ b/src/main/java/fi/pizzalovers/blogbackend/MyRestController.java @@ -57,8 +57,8 @@ public Iterable getBlog(){ //curl -v http://localhost:8080/blogPost/2 @RequestMapping(value = "/blogpost/{blogId}", method = RequestMethod.GET) - public Optional getBlog(@PathVariable long blogId){ - return blogPostRepo.findById(blogId); + public Optional getBlog(@PathVariable String blogId){ + return blogPostRepo.findById(Long.parseLong(blogId)); } //curl -X DELETE http://localhost:8080/blogpost/2 diff --git a/src/main/java/fi/pizzalovers/blogbackend/User.java b/src/main/java/fi/pizzalovers/blogbackend/User.java index 1b6567d..45d16ff 100644 --- a/src/main/java/fi/pizzalovers/blogbackend/User.java +++ b/src/main/java/fi/pizzalovers/blogbackend/User.java @@ -10,7 +10,7 @@ import java.security.SecureRandom; @Entity -@Table(name = "users") +@Table(name = "userna") public class User { @Id @GeneratedValue(strategy = GenerationType.AUTO)