瀏覽代碼

Took care of the initial error you get when you first enable advanced search.

jalbr74 6 年之前
父節點
當前提交
390de997ad
共有 2 個文件被更改,包括 10 次插入8 次删除
  1. 10 6
      client/src/modules/peoplesearch/peoplesearch-base.component.ts
  2. 0 2
      client/src/services/people.service.ts

+ 10 - 6
client/src/modules/peoplesearch/peoplesearch-base.component.ts

@@ -169,19 +169,23 @@ abstract class PeopleSearchBaseComponent {
         this.abortPendingRequests();
         this.searchResult = null;
 
-        if (!this.query && !this.queries) {
-            this.clearSearch();
-            return null;
-        }
-
         const self = this;
-
         let promise;
 
         if (this.advancedSearch) {
+            if (!this.queries || (this.queries.length === 1 && !this.queries[0].key)) {
+                this.clearSearch();
+                return null;
+            }
+
             promise = this.peopleService.advancedSearch(this.queries);
         }
         else {
+            if (!this.query) {
+                this.clearSearch();
+                return null;
+            }
+
             promise = this.peopleService.search(this.query);
         }
 

+ 0 - 2
client/src/services/people.service.ts

@@ -71,8 +71,6 @@ export default class PeopleService implements IPeopleService {
     }
 
     advancedSearch(queries: IQuery[]): IPromise<SearchResult> {
-        console.log('queries: %O', queries);
-
         // Deferred object used for aborting requests. See promise.service.ts for more information
         let httpTimeout = this.$q.defer();