diff --git a/aleksis/apps/chronos/frontend/components/LessonInformation.vue b/aleksis/apps/chronos/frontend/components/LessonInformation.vue index 49c90667bb1eeaf102b4f39fcd7cb201aae4caa8..c73072d08addb34d25589c4e93d5d9046ce7d9eb 100644 --- a/aleksis/apps/chronos/frontend/components/LessonInformation.vue +++ b/aleksis/apps/chronos/frontend/components/LessonInformation.vue @@ -41,20 +41,26 @@ export default { return DateTime.fromISO(dateString); }, getSubject(lesson) { - return lesson.subject - ? lesson.subject - : lesson.course?.subject - ? lesson.course.subject - : lesson.amends?.subject - ? lesson.amends.subject - : undefined; + if (lesson.subject) { + return lesson.subject; + } + else if (lesson.course?.subject) { + return lesson.course.subject; + } + else if (lesson.amends?.subject) { + return lesson.amends.subject; + } + return undefined; }, + getCourse(lesson) { - return lesson.course - ? lesson.course - : lesson.amends?.course - ? lesson.amends.course - : undefined; + if (lesson.course) { + return lesson.course; + } + else if (lesson.amends?.course) { + return lesson.amends.course; + } + return undefined; }, }, }; diff --git a/aleksis/apps/chronos/frontend/components/substitutions/SubstitutionCard.vue b/aleksis/apps/chronos/frontend/components/substitutions/SubstitutionCard.vue index c71cb094508c963fbcd7476361d749121ada0780..55736c9790837c674d9decba0dcacb2ae288c781 100644 --- a/aleksis/apps/chronos/frontend/components/substitutions/SubstitutionCard.vue +++ b/aleksis/apps/chronos/frontend/components/substitutions/SubstitutionCard.vue @@ -375,13 +375,16 @@ export default { return roomsWithStatus; }, subject() { - return this.substitution.subject - ? this.substitution.subject - : this.substitution.course?.subject - ? this.substitution.course.subject - : this.substitution.amends?.subject - ? this.substitution.amends.subject - : undefined; + if (this.substitution.subject) { + return this.substitution.subject; + } + else if (this.substitution.course?.subject) { + return this.substitution.course.subject; + } + else if (this.substitution.amends?.subject) { + return this.substitution.amends.subject; + } + return undefined; }, }, apollo: { diff --git a/aleksis/apps/chronos/frontend/components/substitutions/SubstitutionInformation.vue b/aleksis/apps/chronos/frontend/components/substitutions/SubstitutionInformation.vue index e980fe82a234cd3ee6e0bce5a4f38cf950a9ce04..e86d8ec62d3a29d21c32b0538163d0b370d4d547 100644 --- a/aleksis/apps/chronos/frontend/components/substitutions/SubstitutionInformation.vue +++ b/aleksis/apps/chronos/frontend/components/substitutions/SubstitutionInformation.vue @@ -40,11 +40,13 @@ export default { }, computed: { course() { - return this.substitution.course - ? this.substitution.course - : this.substitution.amends?.course - ? this.substitution.amends.course - : undefined; + if (this.substitution.course) { + return this.substitution.course; + } + else if (this.substitution.amends?.course) { + return this.substitution.amends.course; + } + return undefined; }, }, };