Skip to content
Snippets Groups Projects
Commit 6f55ecd1 authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FIX #17436 TIME 0:10 update data

parent c821aa89
No related branches found
No related tags found
No related merge requests found
...@@ -77,8 +77,6 @@ export class UserComponent implements OnInit { ...@@ -77,8 +77,6 @@ export class UserComponent implements OnInit {
errorMsg: '' errorMsg: ''
}; };
manageableGroups: number[] = [];
constructor( constructor(
public http: HttpClient, public http: HttpClient,
private translate: TranslateService, private translate: TranslateService,
...@@ -110,7 +108,6 @@ export class UserComponent implements OnInit { ...@@ -110,7 +108,6 @@ export class UserComponent implements OnInit {
canSendActivationNotification: false canSendActivationNotification: false
}; };
await this.getManageableGroups(); await this.getManageableGroups();
await this.getGroups();
this.loading = false; this.loading = false;
} else { } else {
this.creationMode = false; this.creationMode = false;
...@@ -370,38 +367,11 @@ export class UserComponent implements OnInit { ...@@ -370,38 +367,11 @@ export class UserComponent implements OnInit {
await alert.present(); await alert.present();
} }
getGroups() {
return new Promise((resolve) => {
this.http.get('../rest/groups').pipe(
tap((data: any) => {
const groups: any[] = [];
data.groups.forEach((element: any) => {
if (this.manageableGroups.indexOf(element.id) > -1) {
groups.push(
{
id: element.id,
label: element.label,
checked: false
}
);
}
});
this.user['groups'] = groups;
resolve(true);
}),
catchError((err: any) => {
this.notificationService.handleErrors(err);
return of(false);
})
).subscribe();
});
}
getManageableGroups() { getManageableGroups() {
return new Promise((resolve) => { return new Promise((resolve) => {
this.http.get('../rest/manageablegroups').pipe( this.http.get('../rest/manageablegroups').pipe(
tap((data: any) => { tap((data: any) => {
this.manageableGroups = data.groups; this.user['groups'] = data.groups;
resolve(true); resolve(true);
}), }),
catchError((err: any) => { catchError((err: any) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment