mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[AAE-5021] Add listPeople method to PeopleContentService (#6947)
* [AAE-5021] Add listPeople method to PeopleContentService * lint * Replace Person with EcmUserModel * Update imports to @alfresco/adf-core * Change to const + lint
This commit is contained in:
@@ -63,6 +63,25 @@ export class PeopleContentService {
|
||||
return this.getPerson('-me-');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a list of people.
|
||||
* @param opts Optional parameters supported by JS-API
|
||||
* @returns Array of people
|
||||
*/
|
||||
listPeople(options?): Observable<EcmUserModel[]> {
|
||||
const promise = this.peopleApi.listPeople(options);
|
||||
return from(promise).pipe(
|
||||
map(response => {
|
||||
const people: EcmUserModel[] = [];
|
||||
response.list.entries.forEach((person: PersonEntry) => {
|
||||
people.push(<EcmUserModel> person?.entry);
|
||||
});
|
||||
return people;
|
||||
}),
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new person.
|
||||
* @param newPerson Object containing the new person details.
|
||||
|
Reference in New Issue
Block a user