Skip to content

Commit

Permalink
Fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
andreilgeorgescu authored Oct 29, 2024
1 parent 753d709 commit 496285c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/CourseCurriculumHelper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ export default function Example(props: Props) {
course_id: number;
}

interface CourseResponse {
updatedLectureSections: LectureSection[];
}

interface Attachment {
id: number;
name?: string;
Expand Down Expand Up @@ -191,7 +195,8 @@ export default function Example(props: Props) {
// };
const call = async () => {
const response = await fetch(`/api/purchase/${props.pricingPlanId}`);
lectureSectionData = response.json().updatedLectureSections;
const course: CourseResponse = (await response.json()) as CourseResponse;
lectureSectionData = course.updatedLectureSections;
if (lectureSectionData.length === 1) {
setLectureSections(lectureSectionData);
setLoading(false);
Expand Down

0 comments on commit 496285c

Please sign in to comment.