mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[ADF-4193] search error notifications and empty results (#4567)
* search error notifications and empty results * update docs
This commit is contained in:
committed by
Eugenio Romano
parent
2c9fdf0d4d
commit
f89bf507f5
@@ -42,8 +42,9 @@ export class SearchQueryBuilderService {
|
||||
|
||||
private _userQuery = '';
|
||||
|
||||
updated: Subject<QueryBody> = new Subject();
|
||||
executed: Subject<ResultSetPaging> = new Subject();
|
||||
updated = new Subject<QueryBody>();
|
||||
executed = new Subject<ResultSetPaging>();
|
||||
error = new Subject();
|
||||
|
||||
categories: Array<SearchCategory> = [];
|
||||
queryFragments: { [id: string]: string } = {};
|
||||
@@ -196,10 +197,23 @@ export class SearchQueryBuilderService {
|
||||
* @returns Nothing
|
||||
*/
|
||||
async execute() {
|
||||
const query = this.buildQuery();
|
||||
if (query) {
|
||||
const resultSetPaging: ResultSetPaging = await this.alfrescoApiService.searchApi.search(query);
|
||||
this.executed.next(resultSetPaging);
|
||||
try {
|
||||
const query = this.buildQuery();
|
||||
if (query) {
|
||||
const resultSetPaging: ResultSetPaging = await this.alfrescoApiService.searchApi.search(query);
|
||||
this.executed.next(resultSetPaging);
|
||||
}
|
||||
} catch (error) {
|
||||
this.error.next(error);
|
||||
|
||||
this.executed.next({
|
||||
list: {
|
||||
pagination: {
|
||||
totalItems: 0
|
||||
},
|
||||
entries: []
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user