// FE
function replySubmit(){
axios.get('http://localhost:8080/reply', {
params:{
userId:8,
postId:1,
contents:replyContent
}
})
.catch(function(error){
...
// BE
@GetMapping("/reply")
public ReplyDTO writeReply(
@RequestParam(value = "user") Long userId,
@RequestParam(value = "post") Long postId,
@RequestParam(value = "contents") String contents){
return replyService.writeReply(userId,postId, contents);
}
GET 메서드를 이용해 댓글 기능을 만들려고 했다.
userId 와 postId 를 임의로 넣어놓고 통신이 되는지 넣어봤는데,


허에에엥??????
userId 에 userId 를 넣는데 왜 user 가 없다하지????
// FE
function replySubmit(){
axios.get('http://localhost:8080/reply', {
params:{
user:8,
post:1,
contents:replyContent
}
})
.catch(function(error){
...
FE 에서 userId 를 user 로 바꾸고, postId 를 post로 바꾸면 된다.
BE 에서 user와 post 로 value 를 설정해놓고 저따위로 보내니 될리가..
생각해보면 댓글 가져오기를 userId 로 가져오고 있으니. 내가 저렇게 보낸 것도 이해가 되기도 한다. 하지만 댕청했다는 건 변하지 않아.
