[week07]발베니 7주차 미션1#140
Merged
Merged
Conversation
Eunjin03
approved these changes
May 19, 2026
Contributor
Eunjin03
left a comment
There was a problem hiding this comment.
안녕하세요 발베니~ 이번 주차도 고생많으셨습니다 ㅎㅎ
mutation에 돌입하며 굉장히 많은 hook들이 생겨났는데, hook 하나하나 이름을 잘 지어주셔서 헷갈림 없이 확인할 수 있었습니다! 또한 api가 없는 경우를 고려하여 로컬에서 최대한 처리하는 식의 방향성도 매우 좋은 것 같습니다.
다음 주차도 화이팅입니다!
|
|
||
| // data.data가 객체이면 빈 배열 반환 (댓글이 없는 경우) | ||
| if (data?.data && typeof data.data === 'object' && !Array.isArray(data.data)) { | ||
| return { data: [] }; |
Contributor
There was a problem hiding this comment.
댓글이 없는 경우 서버에서 null이 오던가요? 데이터 처리를 꼼꼼하게 하셨네요~
| const { mutate: deleteComment, isPending: isDeleting } = useDeleteComment(); | ||
|
|
||
| // 현재 사용자가 댓글 작성자인지 확인 | ||
| const isMyComment = myInfo?.data?.id === comment.userId; |
| }; | ||
|
|
||
| const handleDelete = () => { | ||
| if (!confirm('정말 이 댓글을 삭제하시겠습니까?')) return; |
Contributor
There was a problem hiding this comment.
요기서 만드신 confirm 모달을 사용하시는 것도 ui적으로 더 좋을 수도 있을 것 같네요!
| // 404 에러는 백엔드 API가 아직 구현되지 않았을 수 있음 | ||
| if (error?.response?.status === 404) { | ||
| console.warn('탈퇴 API가 아직 구현되지 않았습니다.'); | ||
| // API가 없어도 로컬에서 로그아웃 처리 |
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.