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/#335] 종료된 공연 예매 불가능 하도록 수정 및 로그인 여부에 따른 공연 등록 페이지 접근 로직 수정 #339

Merged
merged 5 commits into from
Aug 12, 2024

Conversation

pepperdad
Copy link
Member

📌 관련 이슈번호

🎟️ PR 유형

어떤 변경 사항이 있나요?

  • 새 기능 추가
  • 버그 수정
  • CSS 등 사용자 UI 디자인 변경
  • 리팩토링

✅ Key Changes

이번 PR에서 작업한 내용을 간략히 설명해주세요

  • 종료된 공연은 상세페이지에 예매버튼 비활성화
  • 예매 페이지로 바로 접근 시, 리다이렉트 하도록 수정
  • 메인 페이지 플로팅 버튼 우측 하단 고정
  • 공연 등록 버튼 클릭이나 접근 시, 로그인 여부 확인 로직 수정

@github-actions github-actions bot requested a review from imddoy August 10, 2024 07:18
@github-actions github-actions bot added the 🐛 BUG 버그를 고친 경우 label Aug 10, 2024
@github-actions github-actions bot requested a review from ocahs9 August 10, 2024 07:18
@github-actions github-actions bot added the ✨ FEAT 기능 구현 label Aug 10, 2024
@github-actions github-actions bot requested a review from sinji2102 August 10, 2024 07:18
Copy link

PR 작성하느라 고생 많았어요!! 라벨 잘 지정되었는지 확인 한 번 해 주기 🫶

@pepperdad pepperdad changed the title [Fix/#335] 종료된 공연 예매 불가능 하도록 수정, [Fix/#335] 종료된 공연 예매 불가능 하도록 수정 및 로그인 여부에 따른 공연 등록 페이지 접근 로직 수정 Aug 10, 2024
Copy link

@sinji2102 sinji2102 removed the ✨ FEAT 기능 구현 label Aug 10, 2024
Copy link
Contributor

@sinji2102 sinji2102 left a comment

Choose a reason for hiding this comment

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

최고띠예... 의견이 궁금한 부분 남겨두긴 했는데 크게 수정이 필요한 부분은 없어 보여서 어푸할게요~

Comment on lines +30 to +45
if (data) {
const nowDate = new Date();
const lastPerformanceDate = new Date(
data.scheduleList[data?.scheduleList.length - 1].performanceDate
);
if (nowDate > lastPerformanceDate) {
openAlert({
title: "종료된 공연입니다.",
okText: "확인",
okCallback: () => {
navigate("/main");
},
});
}
}
}, [data]);
Copy link
Contributor

@sinji2102 sinji2102 Aug 10, 2024

Choose a reason for hiding this comment

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

p5) 준혁 오빠 코드리뷰에는 서버에서 dueDate를 받는 게 좋을 것 같다고 달았는데... 생각해보니까 간단한 계산이라 클라에서 해도 되나? 싶은 생각이 들어서요!

그때그때 다르겠지만 일반적으로 이렇게 서버에서 dueDate를 가지고 있긴 하지만 넘겨주지 않을 때, 어차피 서버에 가지고 있는 값이긴 하니 dueDate도 함께 달라고 요청하는 게 좋은 방식인지 그냥 위 코드처럼 공연 날짜만 받아서 계산하는 게 좋은 방식인지 궁금함미다............. 아무나 의견 plz

Copy link
Contributor

Choose a reason for hiding this comment

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

p5) 제 생각은 dueDate를 서버에서 받게 된다면, 어차피 회차수에 따라서 yyyy.mm.dd 하나만 받거나 yyyy.mm.dd ~ yyyy.mm.dd 와 같은 형식 2가지로 받게 될텐데 그것도 클라이언트에서 구분해야하긴 하니까.. 크게 리소스가 많이 드는 부분이 아니라고 판단하여 저는 직접 계산하긴 했습니다!

Copy link
Contributor

Choose a reason for hiding this comment

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

앗 제가 언급한 dueDate는 날짜를 받는 게 아니라 공연까지 얼마나 남았느냐에 대한 정보라서 당일이라면 0, 공연 전이라면 1 이상, 공인 이후면 -로 넘어오는 값이라 클라에서 구분할 필요는 없을 것 같아요! 여러 날짜동안 진행되는 정보의 경우에도 서버에서 알맞게 dueDate를 처리해 주고 있는 거로 알고 있습니다

Comment on lines +28 to +34
const nowDate = new Date();
const lastPerformanceDate = new Date(
data?.scheduleList[data?.scheduleList.length - 1]?.performanceDate
);
// 현재 시간이 마지막 공연 시간보다 크면 예매 버튼 비활성화
const isBookDisabled = nowDate > lastPerformanceDate;

Copy link
Contributor

Choose a reason for hiding this comment

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

p5) 이 친구도 위에 리뷰 남긴 것처럼 서버에서 받으면 dueDate < 0 하면 더 간단할 것 같아요!! 이건 그냥 의견이구 뭐가 좋은지는...... 고민 필요..........

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

Choose a reason for hiding this comment

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

p5) 확실히 dueDate 받으면 클라 측은 많이 간단해지긴 하겠네요! 굿

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 +28 to +34
const nowDate = new Date();
const lastPerformanceDate = new Date(
data?.scheduleList[data?.scheduleList.length - 1]?.performanceDate
);
// 현재 시간이 마지막 공연 시간보다 크면 예매 버튼 비활성화
const isBookDisabled = nowDate > lastPerformanceDate;

Copy link
Contributor

Choose a reason for hiding this comment

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

p5) 확실히 dueDate 받으면 클라 측은 많이 간단해지긴 하겠네요! 굿

Comment on lines +31 to +34
const nowDate = new Date();
const lastPerformanceDate = new Date(
data.scheduleList[data?.scheduleList.length - 1].performanceDate
);
Copy link
Contributor

Choose a reason for hiding this comment

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

p5) 역시 직접 계산해버리셨군요! 저도 그리 어렵지 않은 작업이기도 하고, 빠르게 변경할 수 있는거라 직접 구현했는데.. 👍

@ocahs9 ocahs9 merged commit 2160dd8 into develop Aug 12, 2024
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 BUG 버그를 고친 경우
Projects
Status: 🎉Done
Development

Successfully merging this pull request may close these issues.

[ Bug ] 종료된 공연은 상세페이지에 예매버튼 비활성화
3 participants