From 162b64f36669d0a4d111e5f17f918fd325fe497e Mon Sep 17 00:00:00 2001 From: William Jones Date: Wed, 30 Nov 2022 14:36:22 -0500 Subject: [PATCH 1/2] Fixed file error --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 748aeddfa..fa239c224 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ - + + From 62301b749db4f66c63fe03a3322e7620dd1a5277 Mon Sep 17 00:00:00 2001 From: William Jones Date: Mon, 5 Dec 2022 09:38:27 -0500 Subject: [PATCH 2/2] Adding search bar --- js/accident_w_impound.js | 9 +++++++++ other_pages/accident_with_impound.html | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/js/accident_w_impound.js b/js/accident_w_impound.js index 93b98531f..150a4214e 100644 --- a/js/accident_w_impound.js +++ b/js/accident_w_impound.js @@ -59,6 +59,15 @@ async function getData() { return reply; } +function filterList(list, filterInputValue) { + return list.filter((item) => { + if (!item.street_address) { return; } + const lowerCaseName = item.street_address.toLowerCase(); + const lowerCaseQuery = filterInputValue.toLowerCase(); + return lowerCaseName.includes(lowerCaseQuery); + }); + } + async function mainEvent() { // the async keyword means we can make API requests const form = document.querySelector('.main_form'); // get your main form so you can do JS with it diff --git a/other_pages/accident_with_impound.html b/other_pages/accident_with_impound.html index 5d12f6610..75b4ab070 100644 --- a/other_pages/accident_with_impound.html +++ b/other_pages/accident_with_impound.html @@ -29,6 +29,13 @@

Accidents with Impound Occurrences

+
+
+ + +
+ +
A list of accidents with impounds