From d4431d3d200a77f7abfa00e5adc848c633597352 Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Tue, 28 Jun 2022 02:10:17 +1000
Subject: Convert server code to CGI script

Also adjust server-client API, for clarity/consistency
---
 src/components/SearchModal.vue | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

(limited to 'src/components/SearchModal.vue')

diff --git a/src/components/SearchModal.vue b/src/components/SearchModal.vue
index 39bdbdf..2844f5e 100644
--- a/src/components/SearchModal.vue
+++ b/src/components/SearchModal.vue
@@ -103,14 +103,14 @@ export default defineComponent({
 				return;
 			}
 			// Get URL params to use for querying search-suggestions
-			let urlParams = 'name=' + encodeURIComponent(input.value);
+			let urlParams = 'type=sugg&name=' + encodeURIComponent(input.value);
 			urlParams += '&limit=' + this.uiOpts.searchSuggLimit;
-			urlParams += this.uiOpts.useReducedTree ? '&tree=reduced' : '';
+			urlParams += this.uiOpts.useReducedTree ? '&rtree=true' : '';
 			// Query server, delaying/skipping if a request was recently sent
 			this.pendingSuggReqParams = urlParams;
 			let doReq = async () => {
 				let responseObj: SearchSuggResponse =
-					await getServerResponse('/data/search', this.pendingSuggReqParams);
+					await getServerResponse(this.pendingSuggReqParams);
 				if (responseObj == null){
 					return;
 				}
@@ -170,9 +170,9 @@ export default defineComponent({
 				return;
 			}
 			// Ask server for nodes in parent-chain, updates tolMap, then emits search event
-			let urlParams = 'name=' + encodeURIComponent(tolNodeName);
-			urlParams += this.uiOpts.useReducedTree ? '&tree=reduced' : '';
-			let responseObj: {[x: string]: TolNode} = await getServerResponse('/data/chain', urlParams);
+			let urlParams = 'type=node&toroot=true&name=' + encodeURIComponent(tolNodeName);
+			urlParams += this.uiOpts.useReducedTree ? '&rtree=true' : '';
+			let responseObj: {[x: string]: TolNode} = await getServerResponse(urlParams);
 			if (responseObj == null){
 				return;
 			}
-- 
cgit v1.2.3

