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

Fix/#563 머지 컨플릭트 해결 #564

Merged
merged 1 commit into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading