-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix 포스트수정 오류 수정 #19
The head ref may contain hidden characters: "bugfix-\uD3EC\uC2A4\uD2B8\uC218\uC815-\uC624\uB958-\uC218\uC815"
Conversation
…client into bugfix-포스트수정-오류-수정
src/components/Editor.jsx
Outdated
return () => { | ||
if (ref.current) { | ||
ref.current.destroy(); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useEffect 마지막에 해제 하는거 지우셨는데 없어도 되는 코드인가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수정할 때 여기에서 에러가 발생했던 걸로 기억하는데, 혹시 어떤 이유였는지 설명해주실 수 있을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네 기존에는 생성되는 EditorJS 인스턴스가 메모리에 계속 남아서 있어서 destroy로 제거해줬는데
바뀐 방법에는 이미 존재하면 새로운 EditorJS 인스턴스를 생성하지 않고 기존 인스턴스를 재사용하여 destroy를 사용하지 않아도 됩니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/components/Editor.jsx
Outdated
let response = {}; | ||
|
||
if (isModify) { | ||
await axios.put(`/api/v1/posts/${postId}`, postData); | ||
router.push(`/posts/${author}`); | ||
response = await axios.put(`/api/v1/posts/${postId}`, postData); | ||
} else { | ||
response = await axios.post('/api/v1/posts', postData); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
삼항 연산자를 쓰면 response를 const로 선언해서 사용할 수 있을 것 같습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네 의견 감사합니다.
반영하였습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다! 확인했습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
버그 잡느라 수고하셨습니다.
📝 PR 목적
포스트 수정 관련 포스트 생성 컴포넌트 및 이미지 저장 API 오류 수정 작업 #18
2023-08-21.8.01.40.mov
📑 작업 내용
🚧 주의 사항