diff --git a/services/backend/src/services/courses/courseFinders.ts b/services/backend/src/services/courses/courseFinders.ts index b5882bb39..6099effe8 100644 --- a/services/backend/src/services/courses/courseFinders.ts +++ b/services/backend/src/services/courses/courseFinders.ts @@ -4,8 +4,8 @@ import { CourseWithSubsDetails } from '@oodikone/shared/types/course' import { CourseModel } from '../../models' import { dbConnections } from '../../database/connection' -const likeTerm = (userInput: string, type: 'name' | 'code') => { - const searchTerm = userInput.trim().replace(/[\\%_]/g, '') +const likeTerm = (userInput: string | undefined, type: 'name' | 'code') => { + const searchTerm = userInput?.trim().replace(/[\\%_]/g, '') if (!searchTerm) return undefined return type === 'name' diff --git a/services/backend/src/services/populations/closeToGraduation.ts b/services/backend/src/services/populations/closeToGraduation.ts index b1866ee8c..1c23ded77 100644 --- a/services/backend/src/services/populations/closeToGraduation.ts +++ b/services/backend/src/services/populations/closeToGraduation.ts @@ -245,7 +245,7 @@ export const findStudentsCloseToGraduation = async (studentNumbers?: string[]) = include: [ { model: CourseModel, - attributes: ['code', 'course_unit_type', 'groupId'], + attributes: ['code', 'courseUnitType', 'groupId'], }, ], }, diff --git a/services/frontend/src/pages/CourseStatistics/CourseTab/SingleCourseStats/ResultTabs/tabs/tables/AttemptsTable.tsx b/services/frontend/src/pages/CourseStatistics/CourseTab/SingleCourseStats/ResultTabs/tabs/tables/AttemptsTable.tsx index 37e171261..9f9636090 100644 --- a/services/frontend/src/pages/CourseStatistics/CourseTab/SingleCourseStats/ResultTabs/tabs/tables/AttemptsTable.tsx +++ b/services/frontend/src/pages/CourseStatistics/CourseTab/SingleCourseStats/ResultTabs/tabs/tables/AttemptsTable.tsx @@ -89,7 +89,7 @@ export const AttemptsTable = ({ courses: courseCodes, separate, unifyCourses: openOrRegular, - includeSubstitutions: combineSubstitutions, + substitutions: combineSubstitutions, } const searchString = queryParamsToString(queryObject) return `/coursepopulation?${searchString}` diff --git a/services/frontend/src/pages/CourseStatistics/SummaryTab/AttemptsTable/FoldableRow.tsx b/services/frontend/src/pages/CourseStatistics/SummaryTab/AttemptsTable/FoldableRow.tsx index 6b95b9900..cd8639ac6 100644 --- a/services/frontend/src/pages/CourseStatistics/SummaryTab/AttemptsTable/FoldableRow.tsx +++ b/services/frontend/src/pages/CourseStatistics/SummaryTab/AttemptsTable/FoldableRow.tsx @@ -67,7 +67,7 @@ export const FoldableRow = ({ ) : ( - {realisation} + {getTextIn(realisation)} )}