Open Jesulayomy opened 4 weeks ago
React calls are being made in place using direct http links. This can be moved to a separate module and then call paths where needed.
axios .get('http://localhost:5000/api/courses', { withCredentials: true }) .then((res) => { setAllCourses(res.data); setCourses(res.data); }) .catch((err) => { console.log('Error:', err); });
import {axiosHandler} from 'contexts/axios' axiosHandler .get('api/courses', { withCredentials: true }) .then((res) => { setAllCourses(res.data); setCourses(res.data); }) .catch((err) => { console.log('Error:', err); });
Response data also needs to be formatted to use new Django responses.
i want to contribute to this issue
@keshav1441 Granted, please go ahead
React calls are being made in place using direct http links. This can be moved to a separate module and then call paths where needed.
Response data also needs to be formatted to use new Django responses.