From 227e9f317dc15c6b3d73499afb54635c5ff493c8 Mon Sep 17 00:00:00 2001 From: Daniel Egger Date: Tue, 10 Oct 2023 15:20:48 +0200 Subject: [PATCH] Fix loading of DueDates --- .../src/components/dueDates/DueDateSingle.vue | 8 +++---- .../components/header/MainNavigationBar.vue | 2 +- client/src/components/header/MobileMenu.vue | 2 +- client/src/pages/AppointmentsPage.vue | 4 ++-- client/src/pages/DashboardPage.vue | 2 +- client/src/types.ts | 2 +- server/vbv_lernwelt/course/serializers.py | 13 +++--------- .../migrations/0006_duedate_circle_data.py | 17 +++++++++++++++ .../migrations/0007_auto_20231010_1505.py | 21 +++++++++++++++++++ server/vbv_lernwelt/duedate/models.py | 16 ++++++++++++++ server/vbv_lernwelt/duedate/serializers.py | 20 ++++++++---------- .../migrations/0003_truncate_notifications.py | 5 ++++- 12 files changed, 80 insertions(+), 32 deletions(-) create mode 100644 server/vbv_lernwelt/duedate/migrations/0006_duedate_circle_data.py create mode 100644 server/vbv_lernwelt/duedate/migrations/0007_auto_20231010_1505.py diff --git a/client/src/components/dueDates/DueDateSingle.vue b/client/src/components/dueDates/DueDateSingle.vue index 45148417..84fb2306 100644 --- a/client/src/components/dueDates/DueDateSingle.vue +++ b/client/src/components/dueDates/DueDateSingle.vue @@ -17,7 +17,7 @@ const assignmentType = t(props.dueDate.assignment_type_translation_key); const courseSessionsStore = useCourseSessionsStore(); const courseSession = courseSessionsStore.allCourseSessions.find( - (cs: CourseSession) => cs.id === props.dueDate.course_session + (cs: CourseSession) => cs.id === props.dueDate.course_session_id ); if (!courseSession) { @@ -28,10 +28,10 @@ const isExpert = courseSessionsStore.hasCockpit(courseSession); const url = isExpert ? props.dueDate.url_expert : props.dueDate.url; const courseSessionTitle = computed(() => { - if (props.dueDate.course_session) { + if (props.dueDate.course_session_id) { return ( - courseSessionsStore.getCourseSessionById(props.dueDate.course_session)?.title ?? - "" + courseSessionsStore.getCourseSessionById(props.dueDate.course_session_id) + ?.title ?? "" ); } return ""; diff --git a/client/src/components/header/MainNavigationBar.vue b/client/src/components/header/MainNavigationBar.vue index 76a6a92d..375ca904 100644 --- a/client/src/components/header/MainNavigationBar.vue +++ b/client/src/components/header/MainNavigationBar.vue @@ -135,7 +135,7 @@ onMounted(() => {