Switched on the @typescript-eslint/no-non-null-assertion rule in eslint.
Fixed the errors it threw up.
This commit is contained in:
@@ -108,7 +108,7 @@ export class IncentiveComponent implements OnInit {
|
||||
}
|
||||
|
||||
change(row: Incentive, i: number) {
|
||||
row.points = this.form.controls.incentives.controls[i].value.points!;
|
||||
row.points = this.form.controls.incentives.controls[i].value.points ?? 0;
|
||||
this.form.controls.incentives.controls[i].setValue({ points: row.points });
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ export class IncentiveComponent implements OnInit {
|
||||
const array = this.form.controls.incentives;
|
||||
|
||||
this.voucher.incentives.forEach((item, index) => {
|
||||
item.points = array.controls[index].value.points!;
|
||||
item.points = array.controls[index].value.points ?? 0;
|
||||
});
|
||||
return this.voucher;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user