Skip to content

전어진 11주차 과제#86

Open
eojin03 wants to merge 6 commits intosnulion11th-seminar:eojinfrom
eojin03:eojin
Open

전어진 11주차 과제#86
eojin03 wants to merge 6 commits intosnulion11th-seminar:eojinfrom
eojin03:eojin

Conversation

@eojin03
Copy link

@eojin03 eojin03 commented May 31, 2023

No description provided.

@eojin03 eojin03 requested a review from whwoohw May 31, 2023 05:01
Copy link

@whwoohw whwoohw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생했어용! 수정사항들 약간씩 코멘트로 남겨놨으니,
수정사항 반영하고 merge까지 시켜주세욥!


useEffect(() => {
const getUserData = async () => {
if (getCookie("access_token")) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

사실 api 작성할 때 interceptor를 instanceWithToken을 쓰는 순간 access token이 없으면 에러가 뜨기에 굳이 여기에 if 문이 필요할 것 같지는 않아요!


const handleSave = (e) => {
const { id } = e.target;
setIsEdit((prev) => ({ ...prev, [id]: false }));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updateUserInfo api 에서 요청이 성공적으로 전달 되면 새로고침하도록 설정해놨기에 여기서 setIsEdit을 해도 의미가 없습니다! 불필요한 과정이기에 빼는게 좋을 것 같아요!

<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)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기서 userInfo는 input을 통해 수정되는 변수이기에 userinfo.username 을 쓰면 안될 것 같아요!
defaultInfo.username으로 수정해주시는게 좋을 것 같습니당

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants