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