Skip to content

Commit 96303f9

Browse files
fix some types
1 parent f5a6914 commit 96303f9

File tree

2 files changed

+4
-29
lines changed
  • frontends
    • api/src/mitxonline/test-utils/factories
    • main/src/app-pages/ProductPages

2 files changed

+4
-29
lines changed

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

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -279,32 +279,7 @@ const programPageItem: PartialFactory<ProgramPageItem> = (override) => {
279279
electives: [],
280280
},
281281
},
282-
req_tree: [
283-
{
284-
data: {
285-
node_type: "operator",
286-
operator: "all_of",
287-
operator_value: null,
288-
program: faker.lorem.slug(),
289-
course: null,
290-
title: "Required Courses",
291-
elective_flag: false,
292-
},
293-
id: 1,
294-
},
295-
{
296-
data: {
297-
node_type: "operator",
298-
operator: "min_number_of",
299-
operator_value: "2",
300-
program: faker.lorem.slug(),
301-
course: null,
302-
title: "Elective Courses",
303-
elective_flag: true,
304-
},
305-
id: 2,
306-
},
307-
],
282+
req_tree: [],
308283
page: {
309284
feature_image_src: faker.image.urlLoremFlickr({
310285
width: 1134,

frontends/main/src/app-pages/ProductPages/util.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type {
22
V2Program,
3-
V1ProgramRequirement,
3+
V2ProgramRequirement,
44
} from "@mitodl/mitxonline-api-axios/v2"
55
import { V2ProgramRequirementDataNodeTypeEnum } from "@mitodl/mitxonline-api-axios/v2"
66

@@ -14,7 +14,7 @@ enum HeadingIds {
1414

1515
const getElectiveSubtree = (
1616
program: V2Program,
17-
): V1ProgramRequirement | undefined => {
17+
): V2ProgramRequirement | undefined => {
1818
return program.req_tree[0]?.children?.find(
1919
(child) =>
2020
child.data.node_type === V2ProgramRequirementDataNodeTypeEnum.Operator &&
@@ -23,7 +23,7 @@ const getElectiveSubtree = (
2323
}
2424
const getRequiredSubtree = (
2525
program: V2Program,
26-
): V1ProgramRequirement | undefined => {
26+
): V2ProgramRequirement | undefined => {
2727
return program?.req_tree?.[0]?.children?.find(
2828
(child) =>
2929
child.data.node_type === V2ProgramRequirementDataNodeTypeEnum.Operator &&

0 commit comments

Comments
 (0)