From 02e0760e0791b6ba8e2367956c9680faeaa6fac7 Mon Sep 17 00:00:00 2001 From: AnandaTon Date: Fri, 6 Oct 2023 10:36:47 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=20api=20check=20=E0=B9=80=E0=B8=A5=E0=B8=82=E0=B8=9A=E0=B8=B1?= =?UTF-8?q?=E0=B8=95=E0=B8=A3=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=8A=E0=B8=B2?= =?UTF-8?q?=E0=B8=8A=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/exam/api.candidate.ts | 2 ++ .../01_exam/components/Form/Information.vue | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/api/exam/api.candidate.ts b/src/api/exam/api.candidate.ts index 4dce4cf..c34aee5 100644 --- a/src/api/exam/api.candidate.ts +++ b/src/api/exam/api.candidate.ts @@ -5,6 +5,8 @@ const periodExam = `${env.API_URI}/candidate/period-exam/` export default { candidateInformation: (examId: string, positionId: string) => `${candidate}information/${examId}/${positionId}`, + candidateCheckCitizen: (examId: string, positionId: string) => + `${candidate}check/citizen/${examId}/${positionId}`, candidateAddress: (examId: string, positionId: string) => `${candidate}address/${examId}/${positionId}`, candidateFamily: (examId: string, positionId: string) => diff --git a/src/modules/01_exam/components/Form/Information.vue b/src/modules/01_exam/components/Form/Information.vue index f7fb2a8..1ce0db8 100644 --- a/src/modules/01_exam/components/Form/Information.vue +++ b/src/modules/01_exam/components/Form/Information.vue @@ -23,7 +23,8 @@ :class="getClass(status == 'register' || status == 'rejectRegister')" :borderless="!(status == 'register' || status == 'rejectRegister')" :rules="[ - (val) => (val != null && val.length == 13) || `${'กรุณากรอกเลขประจำตัวประชาชนให้ถูกต้อง'}`, + (val) => + (val != null && val.length == 13) || `${'กรุณากรอกเลขประจำตัวประชาชนให้ถูกต้อง'}`, (val) => /^[0-9]*$/.test(val) || `${'กรุณากรอกเลขประจำตัวประชาชนให้ถูกต้อง'}` ]" v-model="defaultInformation.cardid" @@ -484,11 +485,24 @@ const checkCardId = async () => { if (result) { idModel.value = false defaultInformation.value.cardid = cardid2.value + await http + .put(config.API.candidateCheckCitizen(examId.value, positionId.value), { + citizenId: cardid2.value + }) + .then((res) => { + success + }) + .catch((e) => { + messageError($q, e) + }) + .finally(async () => {}) + return } else { notifyError($q, 'กรอกเลขบัตรประชาชนไม่ถูกต้อง') } }) } + const selectPrefix = async () => { defaultInformation.value.prefix = props.prefixOptions.filter((x) => x.id == defaultInformation.value.prefixId).length == 0