Skip to content

Commit 52cb1d8

Browse files
committed
More upstream fixes
1 parent ae79878 commit 52cb1d8

File tree

2 files changed

+9
-7
lines changed
  • frontends
    • api/src/mitxonline/test-utils/factories
    • main/src/app-pages/DashboardPage/CoursewareDisplay

2 files changed

+9
-7
lines changed

frontends/api/src/mitxonline/test-utils/factories/courses.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import { mergeOverrides, makePaginatedFactory } from "ol-test-utilities"
22
import type { PartialFactory } from "ol-test-utilities"
3-
import type { V2CourseWithCourseRuns } from "@mitodl/mitxonline-api-axios/v2"
3+
import type { CourseWithCourseRunsSerializerV2 } from "@mitodl/mitxonline-api-axios/v2"
44
import { faker } from "@faker-js/faker/locale/en"
55
import { UniqueEnforcer } from "enforce-unique"
66

77
const uniqueCourseId = new UniqueEnforcer()
88
const uniqueCourseRunId = new UniqueEnforcer()
99

10-
const course: PartialFactory<V2CourseWithCourseRuns> = (overrides = {}) => {
11-
const defaults: V2CourseWithCourseRuns = {
10+
const course: PartialFactory<CourseWithCourseRunsSerializerV2> = (
11+
overrides = {},
12+
) => {
13+
const defaults: CourseWithCourseRunsSerializerV2 = {
1214
id: uniqueCourseId.enforce(() => faker.number.int()),
1315
title: faker.lorem.words(3),
1416
readable_id: faker.lorem.slug(),
@@ -86,7 +88,7 @@ const course: PartialFactory<V2CourseWithCourseRuns> = (overrides = {}) => {
8688
ingest_content_files_for_ai: faker.datatype.boolean(),
8789
}
8890

89-
return mergeOverrides<V2CourseWithCourseRuns>(defaults, overrides)
91+
return mergeOverrides<CourseWithCourseRunsSerializerV2>(defaults, overrides)
9092
}
9193

9294
const courses = makePaginatedFactory(course)

frontends/main/src/app-pages/DashboardPage/CoursewareDisplay/transform.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import {
88
CourseRunEnrollment,
9-
V2CourseWithCourseRuns,
9+
CourseWithCourseRunsSerializerV2,
1010
V2Program,
1111
V2ProgramCollection,
1212
} from "@mitodl/mitxonline-api-axios/v2"
@@ -72,7 +72,7 @@ const mitxonlineEnrollments = (data: CourseRunEnrollment[]) =>
7272
data.map((course) => mitxonlineEnrollment(course))
7373

7474
const mitxonlineUnenrolledCourse = (
75-
course: V2CourseWithCourseRuns,
75+
course: CourseWithCourseRunsSerializerV2,
7676
): DashboardCourse => {
7777
const run = course.courseruns.find((run) => run.id === course.next_run_id)
7878
return {
@@ -98,7 +98,7 @@ const mitxonlineUnenrolledCourse = (
9898
}
9999

100100
const mitxonlineCourses = (raw: {
101-
courses: V2CourseWithCourseRuns[]
101+
courses: CourseWithCourseRunsSerializerV2[]
102102
enrollments: CourseRunEnrollment[]
103103
}) => {
104104
const enrollmentsByCourseId = groupBy(

0 commit comments

Comments
 (0)