From a3d04f5025f39dbb6145cb59f8262775a59abc23 Mon Sep 17 00:00:00 2001 From: puriphatt Date: Thu, 27 Feb 2025 17:42:13 +0700 Subject: [PATCH] feat: update manage field for localization and add actionRequestWork function --- src/i18n/eng.ts | 2 +- src/i18n/tha.ts | 2 +- src/stores/request-list/index.ts | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/i18n/eng.ts b/src/i18n/eng.ts index 14cac28a..c822240c 100644 --- a/src/i18n/eng.ts +++ b/src/i18n/eng.ts @@ -20,7 +20,7 @@ export default { confirm: 'Confirm', login: 'Login', logout: 'Logout', - manage: 'Manage', + manage: 'Manage {text}', theme: 'Theme', light: 'Light', dark: 'Dark', diff --git a/src/i18n/tha.ts b/src/i18n/tha.ts index 049b0771..c3205cbc 100644 --- a/src/i18n/tha.ts +++ b/src/i18n/tha.ts @@ -20,7 +20,7 @@ export default { confirm: 'ยืนยัน', login: 'เข้าสู่ระบบ', logout: 'ออกจากระบบ', - manage: 'จัดการ', + manage: 'จัดการ{text}', theme: 'ธีม', light: 'สว่าง', dark: 'มืด', diff --git a/src/stores/request-list/index.ts b/src/stores/request-list/index.ts index 0bce74cb..cabff09c 100644 --- a/src/stores/request-list/index.ts +++ b/src/stores/request-list/index.ts @@ -276,6 +276,24 @@ export const useRequestList = defineStore('request-list', () => { return false; } + async function actionRequestWork( + requestDataId: string, + step: number, + body: (Omit & { + requestWorkId: string; + })[], + successAll?: boolean, + ) { + const res = await api.put( + `/request-data/${requestDataId}/request-work/step-status/${step}`, + body, + { params: { successAll } }, + ); + + if (res.status < 400) return res.data; + return null; + } + return { data, page, @@ -296,6 +314,8 @@ export const useRequestList = defineStore('request-list', () => { editStatusRequestWork, cancelRequest, + + actionRequestWork, }; });