ดิง id สมัครสอบจาก path

This commit is contained in:
Kittapath 2023-03-29 12:54:32 +07:00
parent d8e47aad92
commit b5c6c83d62
11 changed files with 75 additions and 31 deletions

View file

@ -369,6 +369,7 @@ import type { Information, DataOption } from '@/modules/01_exam/interface/index/
import { defaultInformation } from '@/modules/01_exam/interface/index/Main'
import HeaderTop from '@/components/top.vue'
import Conference from '@/modules/01_exam/components/Conference.vue'
import { useRoute } from 'vue-router'
const props = defineProps({
prefixOptions: {
@ -402,7 +403,8 @@ const mixin = useCounterMixin()
const store = useExamDataStore()
const { date2Thai, calAge, success, dateToISO } = mixin
const districtOptions = ref<DataOption[]>([])
const candidateId = ref<string>('2223ba53-2fb2-470b-8dc1-27e5471b0331')
const route = useRoute()
const examId = ref<string>(route.params.id.toString())
const edit = ref<boolean>(true)
const informaData = ref<Information>(defaultInformation)
const myform = ref<any>()
@ -422,7 +424,7 @@ onMounted(async () => {
const fetchData = async () => {
loader.value = true
await http
.get(config.API.candidateInformation(candidateId.value))
.get(config.API.candidateInformation(examId.value))
.then((res) => {
const data = res.data.result
informaData.value.prefixId = data.prefixId
@ -458,7 +460,7 @@ const saveData = async () => {
// if (store.consend == true) {
loader.value = true
await http
.post(config.API.candidateInformation(candidateId.value), {
.post(config.API.candidateInformation(examId.value), {
prefixId: informaData.value.prefixId,
lastName: informaData.value.lastname,
citizenProvinceId: informaData.value.provinceId,