mirror of
https://github.com/AmanTahiliani/PeerNotes.git
synced 2026-08-07 11:55:12 -04:00
fix fetching on undefined session
This commit is contained in:
@@ -3,6 +3,7 @@ import { useNavigate } from 'react-router-dom';
|
||||
import '../styles/MainScreenWrapper.css';
|
||||
import { getAuthHeaders } from '../utils/getAuthHeaders';
|
||||
import { Professor, Course, Topic, Semester } from "../types/types";
|
||||
import { getSessionCookie } from '../contexts/session';
|
||||
|
||||
interface Filters extends Record<string, string> {
|
||||
professor: string;
|
||||
@@ -23,6 +24,9 @@ const MainSearch: React.FC = () => {
|
||||
const navigate = useNavigate();
|
||||
|
||||
useEffect(() => {
|
||||
if (!getSessionCookie()) {
|
||||
return;
|
||||
}
|
||||
// Fetch professors
|
||||
fetchProfessors();
|
||||
// Fetch courses
|
||||
|
||||
Reference in New Issue
Block a user