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

Commit 592d58f

Browse files
committed
Break fuzzy search - bugs in log
The bug lies in me being unable to dynamically render the nested locations of each school. I'm sure the problem is easily fixable, but I'm running low on sleep and have to call it a night, but I'm pushing the code I've gotten done anyways.
1 parent 18008ef commit 592d58f

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

src/scenes/home/codeSchools/stateSortedSchools/stateSortedSchools.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,18 @@ class StateSortedSchools extends Component {
4141
// Return true if input matches state code or name (ex: "CA or California")
4242
function matchesState(school, input) {
4343
const stateName = stateCodes[school.state].toUpperCase();
44-
console.log(stateName);
4544
return school.state.includes(input) || stateName.includes(input);
4645
}
4746

4847
this.state.schools.forEach((school) => {
49-
const locations = school.locations.filter(location => matchesState(location, userInput));
50-
51-
if (locations.length > 0) {
52-
const newSchool = Object.assign({}, school);
53-
newSchool.locations = locations;
54-
schools.push(newSchool);
55-
}
48+
schools.push(school.locations.filter(location => matchesState(location, userInput)));
5649
});
5750

5851
return schools;
5952
};
6053

6154
render() {
55+
console.log(this.state.schoolsByState);
6256
const stateSchools = !this.state.schoolsByState ? null : this.state.schoolsByState
6357
.map(school =>
6458
(
@@ -67,11 +61,12 @@ class StateSortedSchools extends Component {
6761
alt={school.name}
6862
schoolName={school.name}
6963
link={school.url}
70-
schoolAddress={school.locations[0].address1}
71-
schoolCity={school.locations[0].city}
72-
schoolState={school.locations[0].state}
64+
schoolAddress={'school.locations[0].address1'}
65+
schoolCity={'school.locations[0].city'}
66+
schoolState={'school.locations[0].state'}
7367
logo={school.logo}
74-
GI={school.va_accepted ? 'Yes' : 'No'}
68+
GI={'Yes'}
69+
// GI={school.locations[0].va_accepted ? 'Yes' : 'No'}
7570
fullTime={school.full_time ? 'Full-Time' : 'Flexible'}
7671
hardware={school.hardware_included ? 'Yes' : 'No'}
7772
/>

0 commit comments

Comments
 (0)