From 202f331e4380d338ad059ea60bd4c8274ab49318 Mon Sep 17 00:00:00 2001
From: "pkim62@illnois.edu" <4321Hana!>
Date: Sat, 13 Nov 2021 21:17:18 -0600
Subject: [PATCH] wow

---
 src/static/script.js     | 9 ++++-----
 src/templates/index.html | 2 +-
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/static/script.js b/src/static/script.js
index 30c3b6f..71528b4 100644
--- a/src/static/script.js
+++ b/src/static/script.js
@@ -105,14 +105,13 @@ function test(querystring) {
 					champ_tier : champ.champ_tier
 					})
 				});
-				console.log(dict);
-				return dict;
+				addTable(dict)
 			}
 		})
 }
 					
-function addTable(querystring) {
-  arr = test(querystring);
+function addTable(arr2) {
+  arr = arr2
   setTimeout(function(){
 	  var myTableDiv = document.getElementById("myDynamicTable");
 	
@@ -128,7 +127,7 @@ function addTable(querystring) {
 	    for (var j = 0; j < 4; j++) {
 	      var td = document.createElement('TD');
 	      td.width = '75';
-	      td.appendChild(document.createTextNode(arr['0']['name']));
+	      td.appendChild(document.createTextNode(arr[j]['name']));
 	      tr.appendChild(td);
 	    }
 	  }
diff --git a/src/templates/index.html b/src/templates/index.html
index 8a5cda6..beb3097 100644
--- a/src/templates/index.html
+++ b/src/templates/index.html
@@ -16,7 +16,7 @@
 			  <button type = "button" onclick="handleGetChamp(field.value)" style="height:50px; width:720px">Get Champ</button><br><br><br><br>
 			  <label>Query (Ex : champion.win_rate: > 55):</label><br><br>
 			  <input type="text" id="field2" name="wr" style="height:50px; width:712px"><br><br>
-			  <button type = "button" onclick="addTable(field2.value)" style="height:50px; width:720px">Get Query</button><br><br><br><br>
+			  <button type = "button" onclick="test(field2.value)" style="height:50px; width:720px">Get Query</button><br><br><br><br>
 			  <button type = "button" onclick="clearValues()" style="height:50px; width:720px">Clear Results</button><br><br>
 		  </form>
 		<table>
-- 
GitLab