feat: Introduce data manager service with PocketBase authentication and professor dashboard.

This commit is contained in:
Elmar Kresse
2025-11-22 22:46:06 +01:00
parent 5f383f5638
commit f40558646c
7 changed files with 85 additions and 2 deletions

View File

@@ -68,6 +68,7 @@ onMounted(async () => {
return (b.confidenceScore || 0) - (a.confidenceScore || 0); // Descending order
});
// Clear temporary entries and set actual modules
modules.value = sortedModules;
// Pre-select modules with confidence score >= 0.7 (good match or better)
@@ -77,12 +78,15 @@ onMounted(async () => {
} catch (error: unknown) {
console.error("Failed to fetch modules", error);
const err = error as { status?: number; message?: string };
// Clear temporary entries on error
modules.value = [];
// If unauthorized, redirect to home
if (err.status === 401 || err.message?.includes("401")) {
pb.authStore.clear();
router.push("/");
}
} finally {
// Always disable loading animation
loading.value = false;
}
});