un admin ne peut plus modifier le pseudo des utilisateurs

This commit is contained in:
MiharyR 2022-01-08 18:34:45 +01:00
parent c2ad7a456a
commit f96177da43
2 changed files with 1 additions and 22 deletions

View file

@ -3,15 +3,6 @@
<h3>Modifier</h3> <h3>Modifier</h3>
<!-- divider -->
<br><mat-divider></mat-divider><br>
<!-- nickname -->
<mat-form-field appearance="fill">
<mat-label>Pseudo</mat-label>
<input matInput type="text" [(ngModel)]="personCopy.nickname" required>
</mat-form-field><br>
<!-- divider --> <!-- divider -->
<mat-divider></mat-divider><br> <mat-divider></mat-divider><br>

View file

@ -87,19 +87,7 @@ export class PopupUpdatePersonAdminComponent implements OnInit
// Check les champs saisis par l'utilisateur // Check les champs saisis par l'utilisateur
checkField(): void checkField(): void
{ {
if(this.personCopy.nickname.length === 0) { if((this.changePassword) && (this.newPassword.length === 0)) {
this.errorMessage = "Veuillez remplir le champ 'pseudo'" ;
this.hasError = true;
}
else if(this.personCopy.email.length === 0) {
this.errorMessage = "Veuillez remplir le champ 'email'" ;
this.hasError = true;
}
else if(!this.checkEmailService.isValidEmail(this.personCopy.email)) {
this.errorMessage = "Email invalide" ;
this.hasError = true;
}
else if((this.changePassword) && (this.newPassword.length === 0)) {
this.errorMessage = "Veuillez remplir le champ 'mot de passe'"; this.errorMessage = "Veuillez remplir le champ 'mot de passe'";
this.hasError = true; this.hasError = true;
} }