From e19fdbba4cf672aee5bfb59b91b6162431d146d3 Mon Sep 17 00:00:00 2001
From: ab <abdullah_ahmed@brown.edu>
Date: Sat, 4 May 2019 18:48:01 -0400
Subject: queries semi work

---
 src/debug/Test.tsx | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

(limited to 'src/debug/Test.tsx')

diff --git a/src/debug/Test.tsx b/src/debug/Test.tsx
index 47cfac2c1..7d72a1ba0 100644
--- a/src/debug/Test.tsx
+++ b/src/debug/Test.tsx
@@ -3,6 +3,9 @@ import * as ReactDOM from 'react-dom';
 import { serialize, deserialize, map } from 'serializr';
 import { URLField, Doc, createSchema, makeInterface, makeStrictInterface, List, ListSpec } from '../fields/NewDoc';
 import { SerializationHelper } from '../client/util/SerializationHelper';
+import { Search } from '../server/Search';
+import { restProperty } from 'babel-types';
+import * as rp from 'request-promise';
 
 const schema1 = createSchema({
     hello: "number",
@@ -76,8 +79,22 @@ class Test extends React.Component {
         // console.log(SerializationHelper.Serialize(l));
     }
 
+    onEnter = async (e: any) => {
+        var key = e.keyCode || e.which;
+        if (key === 13) {
+            var query = e.target.value;
+            await rp.get('http://localhost:1050/search', {
+                qs: {
+                    query
+                }
+            });
+        }
+    }
+
     render() {
-        return <button onClick={this.onClick}>Click me</button>;
+        return <div><button onClick={this.onClick}>Click me</button>
+            <input onKeyPress={this.onEnter}></input>
+        </div>;
     }
 }
 
-- 
cgit v1.2.3-70-g09d2

