mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2010] Move/copy, when searching for folder multiple results are returned (#2727)
* adding debounce time in object picker unify search api fix multiples duplicate result remove limit of 4 character to search * remove three.min.js * remove unused import * tlsint fix and remove file * rename sitesApiService to sitesService as all the other services * fix test timeout async
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { NodePaging } from 'alfresco-js-api';
|
||||
import { NodePaging, QueryBody } from 'alfresco-js-api';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { AuthenticationService } from './authentication.service';
|
||||
@@ -32,21 +32,19 @@ export class SearchService {
|
||||
private apiService: AlfrescoApiService) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute a search against the repository
|
||||
*
|
||||
* @param term Search term
|
||||
* @param options Additional options passed to the search
|
||||
* @returns {Observable<NodePaging>} Search results
|
||||
*/
|
||||
getNodeQueryResults(term: string, options?: SearchOptions): Observable<NodePaging> {
|
||||
return Observable.fromPromise(this.getQueryNodesPromise(term, options))
|
||||
return Observable.fromPromise(this.apiService.getInstance().core.queriesApi.findNodes(term, options))
|
||||
.map(res => <NodePaging> res)
|
||||
.catch(err => this.handleError(err));
|
||||
}
|
||||
|
||||
getQueryNodesPromise(term: string, opts: SearchOptions): Promise<NodePaging> {
|
||||
return this.apiService.getInstance().core.queriesApi.findNodes(term, opts);
|
||||
search(query: QueryBody): Observable<NodePaging> {
|
||||
const searchQuery = Object.assign(query);
|
||||
const promise = this.apiService.getInstance().search.searchApi.search(searchQuery);
|
||||
|
||||
return Observable
|
||||
.fromPromise(promise)
|
||||
.catch(err => this.handleError(err));
|
||||
}
|
||||
|
||||
private handleError(error: any): Observable<any> {
|
||||
|
Reference in New Issue
Block a user