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

Commit 2a16168

Browse files
committed
Refactor the search function for easier reading
1 parent d15708b commit 2a16168

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ class StateSortedSchools extends Component {
3333
searchState = (string) => {
3434
const stringFormat = string.replace(/\w\S*/g, txt => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase());
3535
const schools = [];
36-
this.state.schools.forEach((School) => {
37-
const locations = School.locations.filter(location =>
36+
this.state.schools.forEach((school) => {
37+
const locations = school.locations.filter(location =>
3838
location.state === stringFormat
3939
);
4040
if (locations.length > 0) {
41-
const newSchool = Object.assign({}, School);
41+
const newSchool = Object.assign({}, school);
4242
newSchool.locations = locations;
4343
schools.push(newSchool);
4444
}

0 commit comments

Comments
 (0)