Skip to content
Snippets Groups Projects
Verified Commit 9b569e6a authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FIX #1183 TIME 0:30 refresh substitue and user list in profile

parent aef1878f
No related branches found
No related tags found
No related merge requests found
...@@ -208,7 +208,7 @@ ...@@ -208,7 +208,7 @@
<div class="form-2-col"> <div class="form-2-col">
<mat-form-field style="width:100%"> <mat-form-field style="width:100%">
<mat-select placeholder="{{'lang.chooseSubstitute' | translate}}" name="usersList" <mat-select placeholder="{{'lang.chooseSubstitute' | translate}}" name="usersList"
[(ngModel)]="profileInfo.substitute" (selectionChange)="selectSubstitute($event)"> [(ngModel)]="profileInfo.substitute" (selectionChange)="selectSubstitute($event)" (openedChange)="refreshUserList($event)">
<ng-container *ngFor="let userRest of usersList"> <ng-container *ngFor="let userRest of usersList">
<mat-option *ngIf="userRest.id !== profileInfo.id && !userRest.substitute" <mat-option *ngIf="userRest.id !== profileInfo.id && !userRest.substitute"
[value]="userRest.id"> [value]="userRest.id">
......
...@@ -352,6 +352,7 @@ export class ProfileComponent implements OnInit { ...@@ -352,6 +352,7 @@ export class ProfileComponent implements OnInit {
this.drawSample(); this.drawSample();
} }
if (e.index === 2) { if (e.index === 2) {
this.refreshInfoSubstitute();
this.swithToAdmin(); this.swithToAdmin();
} }
} }
...@@ -404,4 +405,20 @@ export class ProfileComponent implements OnInit { ...@@ -404,4 +405,20 @@ export class ProfileComponent implements OnInit {
this.http.patch('../rest/users/' + this.authService.user.id + '/signatures/substituted', { 'signatures': this.signaturesService.signaturesList }) this.http.patch('../rest/users/' + this.authService.user.id + '/signatures/substituted', { 'signatures': this.signaturesService.signaturesList })
.subscribe(); .subscribe();
} }
refreshUserList(opened: any) {
if (opened) {
this.http.get('../rest/users')
.subscribe((data: any) => {
this.usersList = data.users;
});
}
}
refreshInfoSubstitute() {
this.http.get('../rest/users/' + this.authService.user.id + '/substitute')
.subscribe((data: any) => {
this.authService.user.substitute = data.substitute;
});
}
} }
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