Skip to content

Commit

Permalink
fix: 이미지 업데이트 후 refetch 하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
yeonddori committed Sep 26, 2024
1 parent 4b05cc9 commit 46d6ec0
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/containers/team/TeamModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ const TeamModal = ({ teamInfo, isOpen, onClose }: TeamModalProps) => {
return isValidName && isValidDescription;
};

const updateTeamInfo = () => {
if (teamInfo) {
refetchSideBar();
refetchTeamInfo(teamInfo.id);
resetAndCloseModal();
}
};

const handleEditTeamButtonClick = () => {
if (!isTeamInfoValid()) return;

Expand All @@ -76,13 +84,12 @@ const TeamModal = ({ teamInfo, isOpen, onClose }: TeamModalProps) => {

editTeamImage(teamInfo.id, teamForm).then((editTeamImageResponse) => {
if (editTeamImageResponse.ok) {
resetAndCloseModal();
updateTeamInfo();
}
});
} else {
updateTeamInfo();
}
refetchSideBar();
refetchTeamInfo(teamInfo.id);
resetAndCloseModal();
}
});
}
Expand Down

0 comments on commit 46d6ec0

Please sign in to comment.