fix(encounter): add guard for encounter home

This commit is contained in:
riefive
2025-11-15 07:21:24 +07:00
parent d24596a83e
commit 66ecb000f1
3 changed files with 30 additions and 8 deletions
+4 -1
View File
@@ -44,9 +44,12 @@ const activeTab = computed({
})
const id = typeof route.params.id == 'string' ? parseInt(route.params.id) : 0
const data = ref<any>(null)
if (activePosition.value === 'none') { // if user position is none, redirect to home page
router.push('/')
}
// Function to check if date is invalid (like "0001-01-01T00:00:00Z")
function isValidDate(dateString: string | null | undefined): boolean {
if (!dateString) return false