Commit e46e5b81 authored by Zac Wood's avatar Zac Wood

CourseSectionCard no longer renders static data

parent cdadfe65
Pipeline #2647 passed with stage
in 1 minute and 58 seconds
......@@ -7,11 +7,11 @@ export interface SearchAction {
}
export const searchCourseSections = (crn: string) => async (dispatch: any) => {
const response = await fetch(`http://localhost:3000/api/search?crn=${crn}`);
const object = await response.json();
const response = await fetch(`http://localhost:3000/api/course_sections?crn=${crn}`);
const objects = await response.json();
const results: CourseSection[] = [
{
const results: CourseSection[] = objects.map(
(object: any): CourseSection => ({
id: object.id,
name: object.name,
title: object.title,
......@@ -21,8 +21,8 @@ export const searchCourseSections = (crn: string) => async (dispatch: any) => {
days: object.days,
startTime: object.start_time,
endTime: object.end_time,
},
];
})
);
dispatch({
type: SET_SEARCH_RESULTS,
......
......@@ -20,19 +20,20 @@ const CourseSectionCard = ({
<Card>
<CardBody>
<CardTitle className="mb-4">
<i className="fas fa-hashtag" /> 78212
<i className="fas fa-hashtag" /> {courseSection.crn}
</CardTitle>
<Row>
<Col md="6">
<div className="mb-4">
<h4>Senior Adv Design Project I</h4>
<p>CYSE 492 - 001</p>
<h4>{courseSection.title}</h4>
<p>{courseSection.name}</p>
</div>
<i className="fas fa-chalkboard-teacher fa-fw" /> Gino J Manzo
<i className="fas fa-chalkboard-teacher fa-fw" /> {courseSection.instructor}
<br />
<i className="fas fa-clock fa-fw" /> Thursdays, 4:30 pm - 6:20 pm
<i className="fas fa-clock fa-fw" /> {courseSection.days}, {courseSection.startTime} -{' '}
{courseSection.endTime}
<br />
<i className="fas fa-school fa-fw" /> James Buchanan Hall D023
<i className="fas fa-school fa-fw" /> {courseSection.location}
</Col>
<Col md="6">
<Button
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment