Skip to content

Commit

Permalink
Fix/#563 머지 컨플릭트 해결 (#564)
Browse files Browse the repository at this point in the history
  • Loading branch information
cruelladevil authored Apr 7, 2024
1 parent ea7a498 commit facab98
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,18 @@ import { toPlayingTimeText } from '@/shared/utils/convertTime';
import { postKillingPart } from '../remotes/killingPart';

const RegisterPart = () => {
const navigate = useNavigate();
const { user } = useAuthContext();
const { interval, partStartTime, songId } = useCollectingPartContext();
const video = useVideoPlayerContext();
const { confirmPopup } = useConfirmContext();
const { createKillingPart } = usePostKillingPart();
const voteTimeText = toPlayingTimeText(partStartTime, partStartTime + interval);
const { mutateData: createKillingPart } = useMutation(postKillingPart);
const navigate = useNavigate();

// 현재 useMutation 훅이 response 객체를 리턴하지 않고 내부적으로 처리합니다.
// 때문에 컴포넌트 단에서 createKillingPart 성공 여부에 따라 등록 완료 만료를 처리를 할 수 없어요!
// 현재 비로그인 시에 등록을 누르면 두 개의 모달이 뜹니다.
const handleClickRegisterPart = async () => {
const submitKillingPart = async () => {
video.pause();

const isConfirmed = await confirmPopup({
Expand All @@ -44,7 +42,7 @@ const RegisterPart = () => {
}
};

return <RegisterButton onClick={handleClickRegisterPart}>등록</RegisterButton>;
return <RegisterButton onClick={submitKillingPart}>등록</RegisterButton>;
};

export default RegisterPart;
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/pages/EditProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { useMutation } from '@/shared/hooks/useMutation';
const EditProfilePage = () => {
const { user, logout } = useAuthContext();
const { confirmPopup } = useConfirmContext();
const { mutateData: withdrawMember } = useMutation(deleteMember(user?.memberId));
const { mutateData: withdrawal } = useMutation(deleteMember);
const navigate = useNavigate();

Expand All @@ -30,7 +29,7 @@ const EditProfilePage = () => {
});

if (isConfirmed) {
await withdrawMember();
await withdrawal(user.memberId);
logout();
navigate(ROUTE_PATH.ROOT, { replace: true });
}
Expand Down

0 comments on commit facab98

Please sign in to comment.