Skip to content

Commit

Permalink
Merge pull request #348 from TEAM-BEAT/fix/#347/FixDuplicationRegister
Browse files Browse the repository at this point in the history
[Hotfix/#347] 공연 등록 및 예매 중복 요청 방지
  • Loading branch information
pepperdad authored Aug 16, 2024
2 parents 09af722 + 05528ab commit f4d192d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
9 changes: 6 additions & 3 deletions src/pages/book/Book.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,6 @@ const Book = () => {
}
}, [isLogin, selectedValue, bookerInfo, easyPassword, isTermChecked]);

console.log("booking", isMemberBookPending);

if (isLoading) {
return <Loading />;
}
Expand Down Expand Up @@ -314,7 +312,12 @@ const Book = () => {
<Button variant="gray" size="medium" onClick={handleSheetClose}>
다시 할게요
</Button>
<Button variant="primary" size="medium" onClick={handleClickBookRequst}>
<Button
variant="primary"
size="medium"
disabled={isGuestBookingPending || isMemberBookPending}
onClick={handleClickBookRequst}
>
예매할게요
</Button>
</OuterLayout>
Expand Down
9 changes: 7 additions & 2 deletions src/pages/register/Register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,12 @@ const Register = () => {

const { data, refetch } = useGetPresignedUrl(params);
const { mutate } = usePutS3Upload();
const { mutateAsync: postPerformance } = usePostPerformance();
const { mutateAsync: postPerformance, isPending } = usePostPerformance();

const handleComplete = async () => {
if (isPending) {
return;
}
const { data, isSuccess } = await refetch();

let posterUrls;
Expand Down Expand Up @@ -586,7 +589,9 @@ const Register = () => {
}))}
/>
<S.FooterContainer>
<Button onClick={handleComplete}>완료하기</Button>
<Button onClick={handleComplete} disabled={isPending}>
완료하기
</Button>
</S.FooterContainer>
</>
);
Expand Down

0 comments on commit f4d192d

Please sign in to comment.