diff --git a/src/modules/04_registry/components/Profile.vue b/src/modules/04_registry/components/Profile.vue index 684c719a4..e745a6b8e 100644 --- a/src/modules/04_registry/components/Profile.vue +++ b/src/modules/04_registry/components/Profile.vue @@ -833,9 +833,11 @@ const fetchData = async () => { const reason = reasonOptions.value.filter( (r: DataOption) => r.id == data.leaveReason ); + console.log(reason); + if (reason.length > 0) { leaveReason.value = ` (พ้นจากราชการด้วยสาเหตุ: ${reason[0].name})`; - } else { + } else if (data.leaveReason !== null && data.leaveReason !== "") { leaveReason.value = ` (พ้นจากราชการด้วยสาเหตุ: ${data.leaveReason})`; } reasonStatus.value = reason.length > 0 ? true : false;