@@ -13,22 +13,19 @@ import {
1313 TimetableFormSchema ,
1414 baseTimetableForm ,
1515} from "@/models/timetable-form" ;
16- import { Edit , X } from "lucide-react" ;
16+ import { X } from "lucide-react" ;
1717import { createContext , useEffect , useState } from "react" ;
1818import { useForm , UseFormReturn } from "react-hook-form" ;
1919import { zodResolver } from "@hookform/resolvers/zod" ;
2020import { z } from "zod" ;
2121import {
2222 Select ,
2323 SelectContent ,
24- SelectGroup ,
2524 SelectItem ,
26- SelectLabel ,
2725 SelectTrigger ,
2826 SelectValue ,
2927} from "@/components/ui/select" ;
3028import CourseSearch from "@/pages/TimetableBuilder/CourseSearch" ;
31- import { mockSearchData } from "./mockSearchData" ;
3229import CreateCustomSetting from "./CreateCustomSetting" ;
3330import { formatTime } from "@/utils/format-date-time" ;
3431import { FilterForm , FilterFormSchema } from "@/models/filter-form" ;
@@ -48,7 +45,6 @@ import {
4845import { useSearchParams } from "react-router-dom" ;
4946import OfferingInfo from "./OfferingInfo" ;
5047import { Checkbox } from "@/components/ui/checkbox" ;
51- import { time } from "console" ;
5248
5349type FormContextType = UseFormReturn < z . infer < typeof TimetableFormSchema > > ;
5450export const FormContext = createContext < FormContextType | null > ( null ) ;
@@ -117,7 +113,7 @@ const TimetableBuilder = () => {
117113 resolver : zodResolver ( FilterFormSchema ) ,
118114 } ) ;
119115
120- const [ queryParams , setQueryParams ] = useSearchParams ( ) ;
116+ const [ queryParams ] = useSearchParams ( ) ;
121117 const isEditingTimetable = queryParams . has ( "edit" ) ;
122118 const timetableId = parseInt ( queryParams . get ( "edit" ) || "0" ) ;
123119
@@ -145,7 +141,6 @@ const TimetableBuilder = () => {
145141 const {
146142 data : coursesData ,
147143 isLoading,
148- error,
149144 refetch,
150145 } = useGetCoursesQuery ( {
151146 limit : noSearchAndFilter ( ) ? SEARCH_LIMIT : 10000 ,
@@ -201,7 +196,7 @@ const TimetableBuilder = () => {
201196 const parsedRestrictions = restrictionsData . map (
202197 ( restriction : Restriction ) => ( {
203198 ...restriction ,
204- days : JSON . parse ( restriction . days ) ,
199+ days : JSON . parse ( restriction ? .days ) ,
205200 } ) ,
206201 ) ;
207202 console . log ( "Parsed restrictions" , parsedRestrictions ) ;
@@ -432,7 +427,7 @@ const TimetableBuilder = () => {
432427 < FormField
433428 control = { form . control }
434429 name = "restrictions"
435- render = { ( { field } ) => (
430+ render = { ( ) => (
436431 < FormItem className = "pb-2" >
437432 < p className = "text-sm" >
438433 Enabled Restrictions: { enabledRestrictions . length }
0 commit comments