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) => {

View file

@ -95,6 +95,7 @@ export default {
beforeEdit: 'Before',
afterEdit: 'After',
generated: 'System Generated',
urgent: 'Urgent',
},
menu: {
@ -621,6 +622,7 @@ export default {
contactName: 'Contact Name',
documentReceivePoint: 'Document Drop-Off Point"',
dueDate: 'Quotation Due Date',
special: 'Special',
paymentCondition: 'Payment Terms',
payType: 'Payment Methods',
@ -744,6 +746,9 @@ export default {
codeMisMatch: 'Code Mismatch',
userExists: 'User already exits.',
crossCompanyNotPermit: 'Cannot move between different headoffice',
errorOccure:
'An error has occurred, causing the system to be unable to function. Please try again later.',
invalideData: 'The information is incorrect. Please try again later.',
},
},
};

View file

@ -95,6 +95,7 @@ export default {
beforeEdit: 'ค่าเดิม',
afterEdit: 'แก้ใหม่',
generated: 'ระบบออกให้',
urgent: 'เร่งด่วน',
},
menu: {
@ -619,6 +620,7 @@ export default {
contactName: 'ชื่อผู้ติดต่อ',
documentReceivePoint: 'จุดรับเอกสาร',
dueDate: 'วันครบกำหนดใบเสนอราคา',
special: 'พิเศษ',
paymentCondition: 'เงื่อนไขการชำระเงิน',
payType: 'วิธีการชำระเงิน',
@ -739,6 +741,9 @@ export default {
codeMisMatch: 'รหัสไม่ตรงกัน',
userExists: 'ชื่อผู้ใช้นี้มีอยู่ในระบบอยู่แล้ว',
crossCompanyNotPermit: 'ไม่สามารถดำเนินการระหว่างสำนักงานใหญ่อื่นได้',
errorOccure:
'เกิดข้อผิดพลาดทำให้ระบบไม่สามารถทำงานได้ กรุณาลองใหม่ในภายหลัง',
invalideData: 'ข้อมูลไม่ถูกต้อง กรุณาตรวจสอบใหม่อีกครั้ง',
},
},
};