Switched on the @typescript-eslint/no-non-null-assertion rule in eslint.
Fixed the errors it threw up.
This commit is contained in:
@ -96,10 +96,12 @@ export class AttendanceComponent implements OnInit {
|
||||
getAttendance(): Attendance {
|
||||
const formModel = this.form.value;
|
||||
this.info.date = moment(formModel.date).format('DD-MMM-YYYY');
|
||||
const array = this.form.controls.attendances!;
|
||||
this.info.body.forEach((item, index) => {
|
||||
item.attendanceType.id = array.controls[index].value.attendanceType!;
|
||||
});
|
||||
const array = this.form.controls.attendances;
|
||||
if (array) {
|
||||
this.info.body.forEach((item, index) => {
|
||||
item.attendanceType.id = array.controls[index].value.attendanceType ?? 0;
|
||||
});
|
||||
}
|
||||
return this.info;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user