diff --git a/packages/web/src/components/ModalPopup/ModalMypageModify.tsx b/packages/web/src/components/ModalPopup/ModalMypageModify.tsx index c11c6df99..b0ad3336a 100644 --- a/packages/web/src/components/ModalPopup/ModalMypageModify.tsx +++ b/packages/web/src/components/ModalPopup/ModalMypageModify.tsx @@ -71,7 +71,7 @@ const ButtonProfileImage = () => { }, }); if (data.url) { - const res = await axiosOri({ + await axiosOri({ url: data.url, method: "put", headers: { @@ -79,16 +79,14 @@ const ButtonProfileImage = () => { }, data: image, }); - if (res.status === 200) { - const data2 = await axios({ - url: "/users/editProfileImg/done", - method: "get", - }); - if (data2?.result) { - fetchLoginInfo(); - setProfileAlert("SUCCESS"); - return; - } + const data2 = await axios({ + url: "/users/editProfileImg/done", + method: "get", + }); + if (data2?.result) { + fetchLoginInfo(); + setProfileAlert("SUCCESS"); + return; } } setProfileAlert("FAIL"); diff --git a/packages/web/src/hooks/chat/useSendMessage.tsx b/packages/web/src/hooks/chat/useSendMessage.tsx index efa2aa313..a8f043592 100644 --- a/packages/web/src/hooks/chat/useSendMessage.tsx +++ b/packages/web/src/hooks/chat/useSendMessage.tsx @@ -50,15 +50,13 @@ export default ( }); if (!url || !id) throw new Error(); - const { status: s3Status } = await axiosOri({ + await axiosOri({ url, method: "put", data: file, headers: { "Content-Type": file.type }, }); - if (s3Status !== 204) throw new Error(); - const { result } = await axios({ url: "chats/uploadChatImg/done", method: "post", diff --git a/packages/web/src/hooks/useTaxiAPI/useAxios.tsx b/packages/web/src/hooks/useTaxiAPI/useAxios.tsx index 5204bda8d..2a111153d 100644 --- a/packages/web/src/hooks/useTaxiAPI/useAxios.tsx +++ b/packages/web/src/hooks/useTaxiAPI/useAxios.tsx @@ -42,8 +42,6 @@ const useAxios = () => { `/login?redirect=${encodeURIComponent(currentPath)}` )}` ); - } else if (res.status !== 200) { - throw new Error("Status is not 200!"); } else { if (onSuccess) onSuccess(res.data); return res.data;