#57 makeRequest uses env variable so all requests use the configuration

This commit is contained in:
2023-04-14 12:55:43 -04:00
parent 1f0e8ca905
commit c1a8f04dc7
7 changed files with 31 additions and 11 deletions

View File

@@ -7,7 +7,7 @@ const CoursePage = ({ id }) => {
const [courseData, setCourseData] = useState({});
useEffect(() => {
makeRequest({ url: `http://localhost:5000/course/${id}` })
makeRequest({ endpoint: `course/${id}` })
.then((resp) => resp.json())
.then((data) => {
setCourseData(data);