Skip to content

[week07]발베니 7주차 미션1#140

Merged
Eunjin03 merged 1 commit into
mainfrom
week07_Balvenie_mission1
May 19, 2026
Merged

[week07]발베니 7주차 미션1#140
Eunjin03 merged 1 commit into
mainfrom
week07_Balvenie_mission1

Conversation

@Seongmin0218
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

@Eunjin03 Eunjin03 left a comment

Choose a reason for hiding this comment

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

안녕하세요 발베니~ 이번 주차도 고생많으셨습니다 ㅎㅎ

mutation에 돌입하며 굉장히 많은 hook들이 생겨났는데, hook 하나하나 이름을 잘 지어주셔서 헷갈림 없이 확인할 수 있었습니다! 또한 api가 없는 경우를 고려하여 로컬에서 최대한 처리하는 식의 방향성도 매우 좋은 것 같습니다.

다음 주차도 화이팅입니다!


// data.data가 객체이면 빈 배열 반환 (댓글이 없는 경우)
if (data?.data && typeof data.data === 'object' && !Array.isArray(data.data)) {
return { data: [] };
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

댓글이 없는 경우 서버에서 null이 오던가요? 데이터 처리를 꼼꼼하게 하셨네요~

const { mutate: deleteComment, isPending: isDeleting } = useDeleteComment();

// 현재 사용자가 댓글 작성자인지 확인
const isMyComment = myInfo?.data?.id === comment.userId;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

};

const handleDelete = () => {
if (!confirm('정말 이 댓글을 삭제하시겠습니까?')) return;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

요기서 만드신 confirm 모달을 사용하시는 것도 ui적으로 더 좋을 수도 있을 것 같네요!

// 404 에러는 백엔드 API가 아직 구현되지 않았을 수 있음
if (error?.response?.status === 404) {
console.warn('탈퇴 API가 아직 구현되지 않았습니다.');
// API가 없어도 로컬에서 로그아웃 처리
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

오! 좋네요!!

@Eunjin03 Eunjin03 merged commit 3116d2e into main May 19, 2026
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.

2 participants