Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
설명
대부분 id는 그냥 id로 넣어주시면 되고, body는 http요청할때 body에 담아줄 데이터인데 함수 호출할 때 객체로 담아서 인자로 전달해주시면 됩니다.
axiosInstanceApi.ts에 proxy라는 인스턴스를 추가했습니다. 이유는 인증이 필요한 요청은 모두 API Routes를 이용한 넥스트 서버로 우회하게 되기 때문에 BaseURL을 달리해주기 위함입니다.
(2)번과 동일한데 axiosInstance.post는 클라이언트에서 바로 백엔드로 가는 요청이고 proxy.post는 백엔드 서버가 아닌 저희가 앞으로 만들 /pages 아래 /api 안에 만들 서버함수로 갑니다.