Skip to content

Commit

Permalink
[Fix] [GGFE-207] 에러가 난 경우에도 모달을 닫도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
yoouyeon committed Sep 5, 2023
1 parent ee6d7a5 commit ebea282
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/modal/store/inventory/EditMegaphoneModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export default function EditMegaphoneModal({ receiptId }: EditMegaphoneProps) {
.delete(`/pingpong/megaphones/${megaphoneData.megaphoneId}`)
.then(() => {
alert('확성기가 삭제되었습니다.');
resetModal();
})
.catch((error: unknown) => {
if (isAxiosError<errorPayload>(error) && error.response) {
Expand All @@ -80,6 +79,9 @@ export default function EditMegaphoneModal({ receiptId }: EditMegaphoneProps) {
alert(errorMessages[code]);
else setError('JY07');
} else setError('JY07');
})
.finally(() => {
resetModal();
});
}

Expand Down

0 comments on commit ebea282

Please sign in to comment.