Skip to content

Commit

Permalink
Merge pull request #87 from Choco-Express/dev
Browse files Browse the repository at this point in the history
🚀 Deploy
  • Loading branch information
Chaem03 authored Sep 24, 2024
2 parents 0e370f8 + 48c59e4 commit e3a704f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/apis/instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ instance.interceptors.response.use(
if (error.response && error.response.status !== 200) {
if (error.response.status === 404) {
console.log("404 error: Page not found");
window.location.href = "/error";
// window.location.href = "/error";
}
const errorCode = error.response.data?.errorCode;
if (errorCode === "USER_LOCATION_002") {
console.log(
"USER_LOCATION_002: 사용자와 명소 정보가 일치하지 않습니다."
);
window.location.href = "/error";
// window.location.href = "/error";
} else {
console.log("Unknown error occurred");
window.location.href = "/error";
// window.location.href = "/error";
}
} else if (error.code === "ECONNABORTED") {
console.log("Request timeout");
window.location.href = "/error";
// window.location.href = "/error";
}
return Promise.reject(error);
}
Expand Down
6 changes: 3 additions & 3 deletions src/pages/DetailLetter/DetailLetter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ const DetailLetter = () => {
try {
const response = await instance.delete(`/api/choco/${id}`);

// 204 응답
if (!response || response.status === 204) {
alert("삭제가 완료되었습니다.");
if (response.data) {
console.log("삭제가 완료되었습니다.");

navigate(-1);
} else {
console.error("Unexpected response structure:", response);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/otherboxPage/otherboxPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const OtherboxPage = () => {
// 토큰이 없으면 로그인 페이지로 리다이렉트하고, 돌아올 페이지 정보를 함께 전달
sessionStorage.setItem(
"redirectUrl",
`https://choco-express.site/box/${boxId}/choco`
`https://choco-express.site/box/${boxId}`
);
navigate("/");
} else {
Expand Down

0 comments on commit e3a704f

Please sign in to comment.