get basic results page working

This commit is contained in:
afazio1
2024-04-21 00:21:25 -04:00
parent 4a6aa5faa5
commit 851443f19f
7 changed files with 93 additions and 32 deletions

View File

@@ -1,7 +1,7 @@
import React, { useState, useEffect } from 'react';
import { useNavigate } from 'react-router-dom';
import '../styles/MainScreenWrapper.css';
import { getSessionCookie } from '../contexts/session';
import { getAuthHeaders } from '../utils/getAuthHeaders';
import { Professor, Course, Topic } from "../types/types";
interface Filters extends Record<string, string> {
@@ -30,15 +30,6 @@ const MainSearch: React.FC = () => {
fetchTopics();
}, []);
const getAuthHeaders = () => {
const token = getSessionCookie();
// const token = localStorage.getItem('authToken');
console.log("Using token for API call:", token);
return {
'Authorization': `Token ${token}`,
'Content-Type': 'application/json'
};
};
const fetchProfessors = async () => {
try {