Skip to content

Commit

Permalink
feat: 수정 요청 보냈을 때, 버튼 disabled로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
pepperdad committed Dec 18, 2024
1 parent 14e369f commit c209aa0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/pages/modifyManage/ModifyManage.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
//todo: 서버 작업 완료시, API schema 재생성 및 ERROR 없애기 (Gig.tsx, ModifyManage.tsx)
//todo 보완 설명 - 확인해야하는 API 총 4개
import {
usePerformanceDelete,
usePerformanceEdit,
usePostPerformance,
useUpdatePerformance,
} from "@apis/domains/performances/queries";

Expand Down Expand Up @@ -157,7 +154,7 @@ const ModifyManage = () => {
const { setHeader } = useHeader();

const { data, isLoading, isSuccess } = usePerformanceEdit(Number(performanceId));
const { mutateAsync: updatePerformance } = useUpdatePerformance();
const { mutateAsync: updatePerformance, isPending } = useUpdatePerformance();
const { mutate, mutateAsync } = usePerformanceDelete(); // wf: 가독성을 위해 위랑 이름 맞춰주는게 좋을 듯

//presignedUrl을 받아오기 위한 배열
Expand Down Expand Up @@ -316,7 +313,6 @@ const ModifyManage = () => {

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

//비즈니스 로직 분리 - 공연 수정하기 PUT 요청
const handleComplete = async () => {
Expand Down Expand Up @@ -927,7 +923,9 @@ const ModifyManage = () => {
longitude={dataState.longitude}
/>
<S.FooterContainer>
<Button onClick={handleComplete}>완료하기</Button>
<Button disabled={isPending} onClick={handleComplete}>
완료하기
</Button>
</S.FooterContainer>
</>
);
Expand Down

0 comments on commit c209aa0

Please sign in to comment.