Commit 6f55ecd1 authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FIX #17436 TIME 0:10 update data

parent c821aa89
......@@ -77,8 +77,6 @@ export class UserComponent implements OnInit {
errorMsg: ''
};
manageableGroups: number[] = [];
constructor(
public http: HttpClient,
private translate: TranslateService,
......@@ -110,7 +108,6 @@ export class UserComponent implements OnInit {
canSendActivationNotification: false
};
await this.getManageableGroups();
await this.getGroups();
this.loading = false;
} else {
this.creationMode = false;
......@@ -370,38 +367,11 @@ export class UserComponent implements OnInit {
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() {
return new Promise((resolve) => {
this.http.get('../rest/manageablegroups').pipe(
tap((data: any) => {
this.manageableGroups = data.groups;
this.user['groups'] = data.groups;
resolve(true);
}),
catchError((err: any) => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment