Переглянути джерело

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

jalbr74 6 роки тому
батько
коміт
390de997ad

+ 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();