Open
Conversation
whwoohw
reviewed
May 31, 2023
whwoohw
left a comment
There was a problem hiding this comment.
고생했어용! 수정사항들 약간씩 코멘트로 남겨놨으니,
수정사항 반영하고 merge까지 시켜주세욥!
src/routes/MyPage.jsx
Outdated
|
|
||
| useEffect(() => { | ||
| const getUserData = async () => { | ||
| if (getCookie("access_token")) { |
There was a problem hiding this comment.
사실 api 작성할 때 interceptor를 instanceWithToken을 쓰는 순간 access token이 없으면 에러가 뜨기에 굳이 여기에 if 문이 필요할 것 같지는 않아요!
src/routes/MyPage.jsx
Outdated
|
|
||
| const handleSave = (e) => { | ||
| const { id } = e.target; | ||
| setIsEdit((prev) => ({ ...prev, [id]: false })); |
There was a problem hiding this comment.
updateUserInfo api 에서 요청이 성공적으로 전달 되면 새로고침하도록 설정해놨기에 여기서 setIsEdit을 해도 의미가 없습니다! 불필요한 과정이기에 빼는게 좋을 것 같아요!
src/routes/MyPage.jsx
Outdated
| <div className="justify-center font-bold text-4xl mt-12">My Posts</div> | ||
| <div className="items-center grid grid-cols-2 px-10 mt-10"> | ||
| {postList | ||
| .filter((post) => post.author.username === userInfo.username) |
There was a problem hiding this comment.
여기서 userInfo는 input을 통해 수정되는 변수이기에 userinfo.username 을 쓰면 안될 것 같아요!
defaultInfo.username으로 수정해주시는게 좋을 것 같습니당
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.