Error Handling/node.js
통신 시 다른 엔드포인트의 response message를 출력하는 현상
jjscript
2023. 5. 20. 17:04
728x90
반응형
상황
posts/unhide/:postId와 posts/hide/:postId의 엔드포인트를 patch로 입력하여 response값을 받아오려고 하는데, patch - post/:postId의 response message가 나온다.
router 순서도 확인했고, post/:postId endpoint를 주석처리 해봐도 마찬가지.
하드코딩하는 sql 쿼리문도 문제 없음
원인
router.patch('/hide/:postId', postController.updatePost);에서 다음 경로를 지정해 주는 path가 updatePost로 되어있었기 때문이다.
728x90
반응형