Switched on the @typescript-eslint/no-non-null-assertion rule in eslint.
Fixed the errors it threw up.
This commit is contained in:
@@ -126,12 +126,12 @@ export class UserDetailComponent implements OnInit, AfterViewInit {
|
||||
|
||||
getItem(): User {
|
||||
const formModel = this.form.value;
|
||||
this.item.name = formModel.name!;
|
||||
this.item.password = formModel.password!;
|
||||
this.item.lockedOut = formModel.lockedOut!;
|
||||
this.item.name = formModel.name ?? '';
|
||||
this.item.password = formModel.password ?? '';
|
||||
this.item.lockedOut = formModel.lockedOut ?? true;
|
||||
const array = this.form.controls.roles;
|
||||
this.item.roles.forEach((item, index) => {
|
||||
item.enabled = array.controls[index].value.role!;
|
||||
item.enabled = array.controls[index].value.role ?? false;
|
||||
});
|
||||
return this.item;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user