From 9d61ab89462030d6e79334c1999559820a3c1524 Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Tue, 12 Nov 2024 16:32:32 +0700 Subject: [PATCH] feat: add i18n --- src/i18n/eng.ts | 6 ++++++ src/i18n/tha.ts | 6 ++++++ src/stores/employee/index.ts | 13 ++++++++++--- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/i18n/eng.ts b/src/i18n/eng.ts index 9f26d2be..2cf172b3 100644 --- a/src/i18n/eng.ts +++ b/src/i18n/eng.ts @@ -124,6 +124,12 @@ export default { form: 'Form', properties: 'Properties', designForm: 'Design Form', + passport: 'Passport', + passportNo: 'Passport No.', + visa: 'VISA', + visaNo: 'VISA No.', + enterToAdd: 'Press enter to add.', + forExample: 'eg. {example}', }, menu: { diff --git a/src/i18n/tha.ts b/src/i18n/tha.ts index 07a85896..5ab71647 100644 --- a/src/i18n/tha.ts +++ b/src/i18n/tha.ts @@ -124,6 +124,12 @@ export default { form: 'แบบฟอร์ม', designForm: 'ออกแบบฟอร์ม', properties: 'คุณสมบัติ', + passport: 'หนังสือเดินทาง', + passportNo: 'หมายเลขหนังสือเดินทาง', + visa: 'หนังสือลงตรา', + visaNo: 'หมายเลขหนังสือลงตรา', + enterToAdd: 'กดปุ่ม Enter เพื่อเพิ่ม', + forExample: 'เช่น {example}', }, menu: { diff --git a/src/stores/employee/index.ts b/src/stores/employee/index.ts index 8266b2b5..2f14e3bf 100644 --- a/src/stores/employee/index.ts +++ b/src/stores/employee/index.ts @@ -43,10 +43,17 @@ const useEmployeeStore = defineStore('api-employee', () => { visa?: boolean; zipCode?: string; customerId?: string; + payload?: { passport?: string[] }; }) { - const res = await api.get>(`/employee`, { - params: opts, - }); + const { payload, ...params } = opts || {}; + + const res = payload + ? await api.post>(`/employee`, payload, { + params, + }) + : await api.get>(`/employee`, { + params, + }); if (res && res.status === 200) { data.value = res.data;