diff --git a/web/src/views/DashboardView.vue b/web/src/views/DashboardView.vue index f2477bd..aa0a956 100644 --- a/web/src/views/DashboardView.vue +++ b/web/src/views/DashboardView.vue @@ -21,6 +21,7 @@ import { import http from '../api/http' import { useAuthStore } from '../stores/auth' import StudentDashboardView from './StudentDashboardView.vue' +import TeacherDashboardView from './TeacherDashboardView.vue' interface DashboardData { audience: { @@ -101,6 +102,10 @@ const isStudentOverview = computed(() => ['SuperAdmin', 'AcademicAdmin', 'CollegeAdmin', 'Counselor'].includes(role), ), ) +const isTeacherOverview = computed(() => + roles.value.includes('Teacher') && + !roles.value.some((role) => ['SuperAdmin', 'AcademicAdmin', 'CollegeAdmin', 'Counselor', 'Student'].includes(role)), +) const loading = ref(true) const loadError = ref('') const data = ref(null) @@ -397,7 +402,7 @@ async function loadDashboard() { } onMounted(async () => { - if (isStudentOverview.value) { + if (isStudentOverview.value || isTeacherOverview.value) { loading.value = false return } @@ -407,6 +412,7 @@ onMounted(async () => {