Skip to content

Commit

Permalink
Merge pull request #170 from boostcampwm-2024/fe/feature/market_error…
Browse files Browse the repository at this point in the history
…_handle

[FE/feat] 매매시 에러처리 로직 추가
  • Loading branch information
edder773 authored Dec 4, 2024
2 parents 8c98d37 + 5ba54e2 commit 1784c20
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/frontend/src/services/OrderApi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export const postLimitBuyOrder = async (data: Order) => {

if (response.data.code === 201) {
return { success: true, message: response.data.message };
} else if (response.data.code === 403) {
return { sucess: false, message: response.data.message };
}

return { success: false, message: '알 수 없는 오류가 발생했습니다.' };
Expand All @@ -58,6 +60,8 @@ export const postLimitSellOrder = async (data: Order) => {

if (response.data.code === 201) {
return { success: true, message: response.data.message };
} else if (response.data.code === 403) {
return { sucess: false, message: response.data.message };
}

return { success: false, message: '알 수 없는 오류가 발생했습니다.' };
Expand All @@ -72,7 +76,7 @@ export const postMarketBuyOrder = async (data: Order) => {

if (response.data.code === 201) {
return { success: true, message: response.data.message };
} else if (response.data.code === 400) {
} else if (response.data.code === 400 || response.data.code === 403) {
return { success: true, message: response.data.message };
}

Expand All @@ -88,7 +92,7 @@ export const postMarketSellOrder = async (data: Order) => {

if (response.data.code === 201) {
return { success: true, message: response.data.message };
} else if (response.data.code === 400) {
} else if (response.data.code === 400 || response.data.code === 403) {
return { success: true, message: response.data.message };
}

Expand Down

0 comments on commit 1784c20

Please sign in to comment.