Skip to content

Commit

Permalink
fix: 포트폴리오 이미지 1번째 편집 이후, 2번째 편집시에 폼이 제출이 안되는 버그 해결
Browse files Browse the repository at this point in the history
- useEffect 의존성 배열 내 isSuccessReadUrl -> imageResponse 변경
  • Loading branch information
kimsuyeon0916 committed May 2, 2024
1 parent c6e821e commit 5d01156
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/pages/portfolio/edit/PortfolioEditPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,10 @@ const PortfolioEditPage = () => {
const [isSubmitted, setIsSubmitted] = useState(false);

const uploadImageList = useRecoilValue(uploadImageListState);
const {
data: imageResponse,
refetch: readImageListPresignedUrl,
isSuccess: isSuccessReadUrl,
} = useReadImageListPresignedUrl(uploadImageList[0]?.fileName as string, portfolioId);
const { data: imageResponse, refetch: readImageListPresignedUrl } = useReadImageListPresignedUrl(
uploadImageList[0]?.fileName as string,
portfolioId
);

const uploadImageFileInSuccess = () => {
if (!isSubmitted && imageResponse) {
Expand Down Expand Up @@ -156,7 +155,7 @@ const PortfolioEditPage = () => {
});
});
}
}, [isSuccessReadUrl]);
}, [imageResponse]);

const submitHandler: SubmitHandler<FormValues> = () => {
readImageListPresignedUrl(); // presignedUrl 발급
Expand Down

0 comments on commit 5d01156

Please sign in to comment.