Commit 4a8fbd7a authored by Mattias J Duffy's avatar Mattias J Duffy

you can search by friendly building name

parent e410e4e7
Pipeline #2070 passed with stage
in 1 minute and 39 seconds
...@@ -14,6 +14,7 @@ const CardContainer = ({searchTerm, campusRegion, facilities}) => { ...@@ -14,6 +14,7 @@ const CardContainer = ({searchTerm, campusRegion, facilities}) => {
const facilityLocation = facility.facility_location.building.toLowerCase(); const facilityLocation = facility.facility_location.building.toLowerCase();
const facilityCategory = facility.facility_category.name.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, ''); const facilityCategory = facility.facility_category.name.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, '');
const facilityTags = facility.facility_product_tags; const facilityTags = facility.facility_product_tags;
const friendlyName = facility.friendly_building;
facilityTags.forEach((tag) => { facilityTags.forEach((tag) => {
return tag.toLowerCase(); return tag.toLowerCase();
...@@ -26,7 +27,7 @@ const CardContainer = ({searchTerm, campusRegion, facilities}) => { ...@@ -26,7 +27,7 @@ const CardContainer = ({searchTerm, campusRegion, facilities}) => {
const hasTag = index !== -1; const hasTag = index !== -1;
return facilityName.includes(lSearchTerm) || facilityLocation.includes(lSearchTerm) || return facilityName.includes(lSearchTerm) || facilityLocation.includes(lSearchTerm) ||
facilityCategory.includes(lSearchTerm) || hasTag; facilityCategory.includes(lSearchTerm) || hasTag || facilityLocation.includes(friendlyName);
}; };
return ( return (
......
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