aboutsummaryrefslogtreecommitdiff
path: root/src/client/util
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-12-19 13:00:18 -0500
committerbob <bcz@cs.brown.edu>2019-12-19 13:00:18 -0500
commit8907ea70352d07c80233ff4c3e06c9c543c5be83 (patch)
tree98a07a3b690fa6c3bdfbb22c7fb3cae84172613d /src/client/util
parent582cf89686c55b164d60cfdd85090ac5267ba2eb (diff)
fixing minor details with tree view opening workspace, moving documents in stacking views, avoiding search exceptions,
Diffstat (limited to 'src/client/util')
-rw-r--r--src/client/util/SearchUtil.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/util/SearchUtil.ts b/src/client/util/SearchUtil.ts
index 1fda82880..4f6211d94 100644
--- a/src/client/util/SearchUtil.ts
+++ b/src/client/util/SearchUtil.ts
@@ -34,9 +34,9 @@ export namespace SearchUtil {
export function Search(query: string, returnDocs: false, options?: SearchParams): Promise<IdSearchResult>;
export async function Search(query: string, returnDocs: boolean, options: SearchParams = {}) {
query = query || "*"; //If we just have a filter query, search for * as the query
- const result: IdSearchResult = JSON.parse(await rp.get(Utils.prepend("/search"), {
- qs: { ...options, q: query },
- }));
+ let rpquery = Utils.prepend("/search");
+ let gotten = await rp.get(rpquery, { qs: { ...options, q: query } });
+ const result: IdSearchResult = gotten.startsWith("<") ? { ids: [], docs: [], numFound: 0, lines: [] } : JSON.parse(gotten);
if (!returnDocs) {
return result;
}