fix: dialog error & i18n

This commit is contained in:
puriphatt 2024-10-04 15:11:26 +07:00
parent b20f40658d
commit 20dc04c769
3 changed files with 12 additions and 2 deletions

View file

@ -24,10 +24,10 @@ function parseError(
status: number,
body?: { status: number; message: string; code: string },
) {
if (status === 422) return 'ข้อมูลไม่ถูกต้อง กรุณาตรวจสอบใหม่อีกครั้ง';
if (status === 422) return 'invalideData';
if (body && body.code) return body.code;
return 'เกิดข้อผิดพลาดทำให้ระบบไม่สามารถทำงานได้ กรุณาลองใหม่ในภายหลัง';
return 'errorOccure';
}
api.interceptors.request.use(async (config) => {