Skip to content

Commit 92568f3

Browse files
author
Jeppe Elkjær Jørgensen
committed
IOT-486 fix add error handling for pw
1 parent 03fc163 commit 92568f3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/app/admin/users/user-edit/user-edit.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<div class="form-group mt-3 col-12">
3232
<label class="form-label" for="password">{{'USERS.FORM.PASSWORD' | translate}}</label>*
3333
<input type="text" class="form-control" id="password" name="password"
34-
[placeholder]="'USERS.FORM.PASSWORD-PLACEHOLDER' | translate" maxlength="50" required
34+
[placeholder]="'USERS.FORM.PASSWORD-PLACEHOLDER' | translate" minlength="6" maxlength="50" required
3535
[(ngModel)]="user.password"
3636
[ngClass]="{'is-invalid' : formFailedSubmit && errorFields.includes('password'), 'is-valid' : formFailedSubmit && !errorFields.includes('password')}">
3737
</div>

src/app/admin/users/user-edit/user-edit.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export class UserEditComponent implements OnInit {
9999
this.errorFields = [];
100100
this.errorMessages = [];
101101
if (error.error?.message?.length > 0) {
102-
error.error.message[0].children.forEach((err) => {
102+
error.error.message.forEach((err) => {
103103
this.errorFields.push(err.property);
104104
this.errorMessages = this.errorMessages.concat(
105105
Object.values(err.constraints)

0 commit comments

Comments
 (0)