Skip to content
This repository was archived by the owner on Jun 10, 2019. It is now read-only.

Commit 18008ef

Browse files
committed
Use API for json endpoint - bug in log
- If a school has multiple VA-Approved locations, only one will show
1 parent 4f38d6b commit 18008ef

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/scenes/home/codeSchools/approvedSchools/approvedSchools.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import Section from 'shared/components/section/section';
33
import SchoolCard from 'shared/components/schoolCard/schoolCard';
44
import styles from './approvedSchools.css';
55

6-
// const endpoint = 'https://api.operationcode.org/api/v1/code_schools.json';
7-
const endpoint = 'https://raw.githubusercontent.com/OperationCode/operationcode_frontend/code-schools-cooper-kyle/src/scenes/home/codeSchools/schools.json';
8-
const gettingSchoolData = fetch(endpoint)
6+
const gettingSchoolData = fetch('https://api.operationcode.org/api/v1/code_schools.json')
97
.then(response => response.json());
108

119
class ApprovedSchools extends Component {
@@ -22,7 +20,7 @@ class ApprovedSchools extends Component {
2220

2321
render() {
2422
const vaSchools = !this.state.vaSchools ? null : this.state.vaSchools
25-
.filter(school => school.va_accepted)
23+
.filter(school => school.locations[0].va_accepted)
2624
.map(school =>
2725
(
2826
<SchoolCard
@@ -34,7 +32,7 @@ class ApprovedSchools extends Component {
3432
schoolCity={school.locations[0].city}
3533
schoolState={school.locations[0].state}
3634
logo={school.logo}
37-
GI={school.va_accepted ? 'Yes' : 'No'}
35+
GI={school.locations[0].va_accepted ? 'Yes' : 'No'}
3836
fullTime={school.full_time ? 'Full-Time' : 'Flexible'}
3937
hardware={school.hardware_included ? 'Yes' : 'No'}
4038
/>

0 commit comments

Comments
 (0)