Skip to content

Conversation

@99minji
Copy link
Collaborator

@99minji 99minji commented Nov 14, 2024

이슈번호 #85

작업내용

  • 즐겨찾기 버튼 클릭 시 즐겨찾기 되도록 구현했습니다.
  • 폴더 구조 변경했습니다.
기존 변경 후
/api/links/[linkId].ts /api/links/[linkId]/index.ts
/api/links/[linkId]/favorite.ts

Screenshot 2024-11-14 at 21 11 54

@99minji 99minji linked an issue Nov 14, 2024 that may be closed by this pull request
@junjeeong
Copy link
Collaborator

고생하셨습니다!

/>
{/* isFavoritePage일 때만 즐겨찾기 버튼 렌더링 */}
{!isFavoritePage && (
<div
Copy link
Collaborator

@junjeeong junjeeong Nov 14, 2024

Choose a reason for hiding this comment

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

케밥 버튼과 즐겨찾기 버튼이 isFavoritePage이냐 아니냐에 따라서 조건부 렌더링이 되니
컴포넌트로 따로 만들어도 좋을 것 같다는 생각이 드네요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

오 리팩토링 때 진행해보겠습니다~!

</div>
<CardsLayout>
{linkCardList.map((link) => (
<LinkCard
Copy link
Collaborator

@junjeeong junjeeong Nov 14, 2024

Choose a reason for hiding this comment

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

컴포넌트가 많이 가벼워진게 보기 좋네요!

await putLinkFavorite(info.id, { favorite: !isSubscribed });
updateFavorite(info.id, !isSubscribed);
} catch (error) {
console.error("즐겨찾기 설정 중 오류 발생:", error);
Copy link
Collaborator

Choose a reason for hiding this comment

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

이 부분도 토스트 적용하는게 좋을까요? (즐겨찾기 추가/실패)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

이 부분보다는 드롭다운에 수정하기, 삭제하기 했을 때 토스팅 적용이 더 나을 것 같습니다!

Copy link
Collaborator

@hongggyelim hongggyelim left a comment

Choose a reason for hiding this comment

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

수고하셨습니닷!

@99minji 99minji merged commit ccf3af7 into develop Nov 15, 2024
1 check passed
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.

즐겨찾기 기능 구현

4 participants