- const apiURLHeader: APIURLHEADER = {
- url: environment.USERS_URL + '/' + this.userID,
- httpOptions: { headers: this.headers }
- };
- this.restService.patchResource(apiURLHeader, payLoad).subscribe((result: {}) => {
- this.checkUsername(payLoad);
- this.activeModal.close(this.modalData);
- this.isLoadingResults = false;
- this.notifierService.notify('success', this.translateService.instant('PAGE.USERS.EDITEDSUCCESSFULLY'));
- }, (error: ERRORDATA) => {
- this.restService.handleError(error, 'put');
- this.isLoadingResults = false;
- });
- }
- /** Get domain name @private */
- private getDomainName(): void {
- this.isLoadingResults = true;
- this.restService.getResource(environment.DOMAIN_URL).subscribe((domains: { project_domain_name: string, user_domain_name: string }) => {
- let domainNames: string[] = [];
- if (!isNullOrUndefined(domains.project_domain_name)) {
- domainNames = domainNames.concat(domains.project_domain_name.split(','));
- }
- if (!isNullOrUndefined(domains.user_domain_name)) {
- domainNames = domainNames.concat(domains.user_domain_name.split(','));
- }
- domainNames = Array.from(new Set(domainNames));
- this.checkDomainNames(domainNames);
- this.isLoadingResults = false;
- }, (error: ERRORDATA) => {
- this.restService.handleError(error, 'get');
- this.isLoadingResults = false;
- });
- }
-
- /** Check the domain names and create modal for domain select @private */
- private checkDomainNames(domainNames: string[]): void {
- if (domainNames.length > 0) {
- domainNames.forEach((domainName: string) => {
- if (!domainName.endsWith(':ro')) {
- this.domains.push({ id: domainName, text: domainName });