Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…orea into feat/#773
  • Loading branch information
00kang committed Nov 25, 2024
2 parents 9981209 + 66148a4 commit d53e91d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
18 changes: 8 additions & 10 deletions frontend/src/components/roomDetailPage/myReviewee/MyReviewee.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,14 @@ const MyReviewee = ({ roomInfo }: MyRevieweeProps) => {
if (loadingButtonId.includes(reviewee.userId)) return;
setLoadingButtonId((prev) => [...prev, reviewee.userId]);

postReviewCompleteMutation.mutate(
{ roomId: roomInfo.id, revieweeId: reviewee.userId },
{
onSuccess: () => {
handleNavigateFeedbackPage(reviewee);
setLoadingButtonId((prev) => prev.filter((id) => id !== reviewee.userId));
},
onError: () => setLoadingButtonId((prev) => prev.filter((id) => id !== reviewee.userId)),
},
);
postReviewCompleteMutation
.mutateAsync({ roomId: roomInfo.id, revieweeId: reviewee.userId })
.then(() => {
handleNavigateFeedbackPage(reviewee);
})
.finally(() => {
setLoadingButtonId((prev) => prev.filter((id) => id !== reviewee.userId));
});
};

// 리뷰 및 피드백 여부 버튼 렌더링 함수
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,11 @@ const RoomCardModalButton = ({ roomInfo }: RoomCardModalButtonProps) => {
</S.FormWrapper>
</S.FormContainer>

<Button variant="primary" size="small" onClick={handleNoticeModal}>
<Button
variant="primary"
size="small"
onClick={roomInfo.isPublic ? handleParticipateRoomClick : handleNoticeModal}
>
참여하기
</Button>
</S.ButtonContainer>
Expand Down

0 comments on commit d53e91d

Please sign in to comment.