@@ -13,6 +13,12 @@ import { SchedulerView } from "./calendar/SchedulerView";
1313import { ScheduleSidebar } from "./right-sidebar/ScheduleSidebar" ;
1414import { FilterPanel } from "./left-sidebar/FilterPanel" ;
1515import { GroupedTerms , Campus , Nupath } from "@/lib/catalog/types" ;
16+ import {
17+ PlanData ,
18+ PlanCourse ,
19+ PlanSection ,
20+ PlanUpdateData ,
21+ } from "@/lib/scheduler/types" ;
1622
1723interface SchedulerWrapperProps {
1824 nupathOptions : { label : string ; value : string } [ ] ;
@@ -128,7 +134,7 @@ export function SchedulerWrapper({
128134 return ;
129135 }
130136
131- const planData = await response . json ( ) ;
137+ const planData = ( await response . json ( ) ) as PlanData ;
132138 setPlanId ( planIdNum ) ;
133139 setPlanName ( planData . name ) ;
134140
@@ -138,13 +144,13 @@ export function SchedulerWrapper({
138144 const allCourseIds : number [ ] = [ ] ;
139145
140146 if ( planData . courses && Array . isArray ( planData . courses ) ) {
141- planData . courses . forEach ( ( course : any ) => {
147+ planData . courses . forEach ( ( course : PlanCourse ) => {
142148 allCourseIds . push ( course . courseId ) ;
143149 if ( course . isLocked ) {
144150 lockedCourseIds . add ( course . courseId ) ;
145151 }
146152 if ( course . sections && Array . isArray ( course . sections ) ) {
147- course . sections . forEach ( ( section : any ) => {
153+ course . sections . forEach ( ( section : PlanSection ) => {
148154 if ( section . isHidden ) {
149155 hiddenSectionIds . add ( section . sectionId ) ;
150156 }
@@ -158,7 +164,7 @@ export function SchedulerWrapper({
158164 ...filters ,
159165 startTime : planData . startTime ,
160166 endTime : planData . endTime ,
161- specificDaysFree : planData . freeDays ,
167+ specificDaysFree : planData . freeDays ?. map ( Number ) ,
162168 includeHonors : planData . includeHonorsSections ,
163169 includesRemote : planData . includeRemoteSections ,
164170 minSeatsLeft : planData . hideFilledSections ? 1 : undefined ,
@@ -326,14 +332,14 @@ export function SchedulerWrapper({
326332 const lockedChanged = ! setsEqual ( currentLocked , prevLocked ) ;
327333 const hiddenChanged = ! setsEqual ( currentHidden , prevHidden ) ;
328334
329- const updateData : any = {
335+ const updateData : PlanUpdateData = {
330336 startTime : filters . startTime ?? null ,
331337 endTime : filters . endTime ?? null ,
332338 freeDays : filters . specificDaysFree ?? [ ] ,
333339 includeHonorsSections : filters . includeHonors ?? false ,
334340 includeRemoteSections : filters . includesRemote ?? true ,
335341 hideFilledSections : ( filters . minSeatsLeft ?? 0 ) > 0 ,
336- nupaths : filters . nupaths ?? [ ] ,
342+ nupaths : [ ] ,
337343 numCourses : filters . numCourses ,
338344 } ;
339345
0 commit comments