Fix Academy page crash: optional chaining for byStatus and categoryInfo fallback
- statistics.byStatus.in_progress could crash on empty object → optional chaining - COURSE_CATEGORY_INFO[course.category] could return undefined → fallback to 'custom' - Update LLM model to qwen3.5:35b-a3b in docker-compose.yml Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -125,7 +125,7 @@ function StatCard({
|
||||
}
|
||||
|
||||
function CourseCard({ course, enrollmentCount }: { course: Course; enrollmentCount: number }) {
|
||||
const categoryInfo = COURSE_CATEGORY_INFO[course.category]
|
||||
const categoryInfo = COURSE_CATEGORY_INFO[course.category] || COURSE_CATEGORY_INFO['custom']
|
||||
|
||||
return (
|
||||
<Link href={`/sdk/academy/${course.id}`}>
|
||||
@@ -589,7 +589,7 @@ export default function AcademyPage() {
|
||||
/>
|
||||
<StatCard
|
||||
label="Aktive Teilnehmer"
|
||||
value={statistics.byStatus.in_progress + statistics.byStatus.not_started}
|
||||
value={(statistics.byStatus?.in_progress || 0) + (statistics.byStatus?.not_started || 0)}
|
||||
color="blue"
|
||||
/>
|
||||
<StatCard
|
||||
|
||||
Reference in New Issue
Block a user