fix : 코드 정리 및 가격조사 기능 추가 완료

This commit is contained in:
Yesol Choi
2025-05-26 11:12:10 +09:00
parent 2673aa7dc7
commit 0f4272ed48
4 changed files with 124 additions and 77 deletions

View File

@@ -233,7 +233,16 @@ export async function putSurveyPrcsNo(params = {}) {
const result = await axios.put(`/api/prcs/survey${params}`)
return result.data
} catch (e) {
throw new Error(e)
const serverError = e.response?.data;
const message = typeof serverError?.body === 'string'
? serverError.body
: 'Unknown error occurred';
const error = new Error(message); // ✅ 반드시 string만 넣기! 아니면 객체가 문자열로 나옴
error.code = serverError?.code;
error.errTime = serverError?.errTime;
throw error;
}
}