mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-5343] add update person api (#7426)
* add update person api * fix e2e tests
This commit is contained in:
@@ -19,7 +19,7 @@ import { Injectable } from '@angular/core';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { catchError, map } from 'rxjs/operators';
|
||||
import { PersonEntry, PeopleApi, PersonBodyCreate, Pagination } from '@alfresco/js-api';
|
||||
import { PersonEntry, PeopleApi, PersonBodyCreate, Pagination, PersonBodyUpdate } from '@alfresco/js-api';
|
||||
import { EcmUserModel } from '../models/ecm-user.model';
|
||||
import { LogService } from './log.service';
|
||||
|
||||
@@ -117,6 +117,20 @@ export class PeopleContentService {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the person details
|
||||
* @param personId The identifier of a person
|
||||
* @param details The person details
|
||||
* @param opts Optional parameters
|
||||
* @returns Updated person model
|
||||
*/
|
||||
updatePerson(personId: string, details: PersonBodyUpdate, opts?: any): Observable<EcmUserModel> {
|
||||
return from(this.peopleApi.updatePerson(personId, details, opts)).pipe(
|
||||
map((res: PersonEntry) => <EcmUserModel> res?.entry),
|
||||
catchError((error) => this.handleError(error))
|
||||
);
|
||||
}
|
||||
|
||||
async isContentAdmin(): Promise<boolean> {
|
||||
if (!this.hasCheckedIsContentAdmin) {
|
||||
const user: PersonEntry = await this.getCurrentPerson().toPromise();
|
||||
|
Reference in New Issue
Block a user