Skip to content

Commit

Permalink
Merge pull request #382 from TEAM-BEAT/feat/#377/FixBookAPI
Browse files Browse the repository at this point in the history
[Fix/#377] 예매하기 API 오류 수정
  • Loading branch information
pepperdad authored Aug 31, 2024
2 parents c60fda9 + 2081af1 commit 49da59d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/pages/book/Book.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ const Book = () => {
scheduleNumber: getScheduleNumberById(data?.scheduleList!, selectedValue!),
purchaseTicketCount: round,
totalPaymentAmount: (data?.ticketPrice ?? 0) * round,
// TODO: 상수로 관리
bookingStatus: "CHECKING_PAYMENT",
} as GuestBookingRequest;

if (!isLogin) {
Expand All @@ -158,7 +160,6 @@ const Book = () => {
...formData,
...bookerInfo,
password: easyPassword.password,
isPaymentCompleted: false,
} as GuestBookingRequest;
} else {
// 회원 예매 요청
Expand All @@ -184,6 +185,11 @@ const Book = () => {
});
} catch (error) {
const errorResponse = error.response?.data as ErrorResponse;
if (errorResponse.status === 500) {
openAlert({
title: "서버 내부 오류로 예매가 불가능합니다.",
});
}
if (errorResponse.status === 409) {
openAlert({
title: "이미 매진된 공연입니다.",
Expand Down

0 comments on commit 49da59d

Please sign in to comment.