diff --git a/src/modules/04_registryNew/components/detail/PersonalInformation/01_Profile.vue b/src/modules/04_registryNew/components/detail/PersonalInformation/01_Profile.vue index 6ca2aaab9..03579f3ab 100644 --- a/src/modules/04_registryNew/components/detail/PersonalInformation/01_Profile.vue +++ b/src/modules/04_registryNew/components/detail/PersonalInformation/01_Profile.vue @@ -137,7 +137,9 @@ const columnsHistory = ref([ field: "birthDate", headerStyle: "font-size: 14px", style: "font-size: 14px", - format: (v) => date2Thai(v), + format: (v) => { + return v ? date2Thai(v) : ""; + }, sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, @@ -265,17 +267,15 @@ async function getData() { showLoader(); http .get(config.API.registryNewByProfileId(profileId.value, empType.value)) - .then(async (res) => { - informaData.value = await res.data.result; - if (informaData.value) { - id.value = informaData.value.id; + .then((res) => { + informaData.value = res.data.result; + id.value = res.data.result.id; - if (informaData.value.birthDate) { - console.log("birthDate===>", informaData.value.birthDate); + if (res.data.result.birthDate) { + console.log("birthDate===>", res.data.result.birthDate); - age.value = calculateAge(informaData.value.birthDate); - console.log("age===>", age.value); - } + age.value = calculateAge(res.data.result.birthDate); + console.log("age===>", age.value); } }) .catch((e) => {