Skip to content

Commit

Permalink
Changed request body from long to String.
Browse files Browse the repository at this point in the history
  • Loading branch information
Waffaru committed Apr 25, 2018
1 parent 97f0cbf commit 501ebbb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public Iterable<BlogPost> getBlog(){

//curl -v http://localhost:8080/blogPost/2
@RequestMapping(value = "/blogpost/{blogId}", method = RequestMethod.GET)
public Optional<BlogPost> getBlog(@PathVariable long blogId){
return blogPostRepo.findById(blogId);
public Optional<BlogPost> getBlog(@PathVariable String blogId){
return blogPostRepo.findById(Long.parseLong(blogId));
}

//curl -X DELETE http://localhost:8080/blogpost/2
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/fi/pizzalovers/blogbackend/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import java.security.SecureRandom;

@Entity
@Table(name = "users")
@Table(name = "userna")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
Expand Down

0 comments on commit 501ebbb

Please sign in to comment.