File tree Expand file tree Collapse file tree 1 file changed +0
-18
lines changed Expand file tree Collapse file tree 1 file changed +0
-18
lines changed Original file line number Diff line number Diff line change @@ -21,25 +21,7 @@ function SearchbarSubjectList({
2121 const [ courses , setCourses ] = useState < string [ ] > ( [ ] ) ;
2222 const suggestionsRef = useRef < HTMLUListElement | null > ( null ) ;
2323
24- const fetchCourses = async ( ) => {
25- try {
26- setLoading ( true ) ;
27- const response = await axios . get < ICourses [ ] > ( "/api/course-list" ) ;
28- const fetchedCourses = response . data . map (
29- ( course : { name : string } ) => course . name ,
30- ) ;
31- setCourses ( fetchedCourses ) ;
32- setLoading ( false ) ;
33- } catch ( err ) {
34- console . error ( "Error fetching courses:" , err ) ;
35- setError ( "Failed to fetch courses" ) ;
36- setLoading ( false ) ;
37- }
38- } ;
3924
40- useEffect ( ( ) => {
41- void fetchCourses ( ) ;
42- } , [ ] ) ;
4325
4426 const debouncedSearch = useCallback (
4527 debounce ( ( text : string ) => {
You can’t perform that action at this time.
0 commit comments