Skip to content
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

useMutationPostLike type에서 data 제거 #917

Merged
merged 2 commits into from
Oct 9, 2024
Merged

useMutationPostLike type에서 data 제거 #917

merged 2 commits into from
Oct 9, 2024

Conversation

j-nary
Copy link
Member

@j-nary j-nary commented Oct 9, 2024

🚩 관련 이슈

📸 스크린샷

-잘 작동되는 거 확인했습니다!

2024-10-09.10.01.45.mov

@j-nary j-nary self-assigned this Oct 9, 2024
Copy link

height bot commented Oct 9, 2024

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

? previousPost.data.likeCount && previousPost.data.likeCount - 1
: previousPost.data.likeCount && previousPost.data.likeCount + 1;
const newLikeCount = previousPost.isLiked
? previousPost.likeCount && previousPost.likeCount - 1
Copy link
Contributor

@borimong borimong Oct 9, 2024

Choose a reason for hiding this comment

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

슬랙에서도 이야기했었지만, 이렇게 될 경우 likeCount 가 0 이 될 때 falsy 한 값으로 처리되게 되어요. 그래서 제가 슬랙에 보내드린 사진처럼 || 0 을 활용하거나, 서버 api 에서 타입을 undefined | number > number 로 바꾸어주어야 해요~

Copy link
Member Author

Choose a reason for hiding this comment

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

앗 네 ..! 서버 api 타입 변경까지 pending 하겠습니다!!

Copy link
Member Author

Choose a reason for hiding this comment

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

반영 완료했습니다!

Copy link
Contributor

@ocahs9 ocahs9 left a comment

Choose a reason for hiding this comment

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

LGTM~ 머지하셔도 될 것 같습니다!

Comment on lines +87 to +88
draft.isLiked = !previousPost.isLiked;
draft.likeCount = newLikeCount;
Copy link
Contributor

Choose a reason for hiding this comment

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

아 한번 더 감싸서 오는 에러가 있었구나..!
잘 찾아냈네요 굿굿

@j-nary j-nary merged commit 8bb4d3a into develop Oct 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

useMutationPostLike 미작동 이슈 해결
3 participants