fix: dialog error & i18n
This commit is contained in:
parent
b20f40658d
commit
20dc04c769
3 changed files with 12 additions and 2 deletions
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue