Switched on the @typescript-eslint/no-non-null-assertion rule in eslint.
Fixed the errors it threw up.
This commit is contained in:
@@ -118,7 +118,7 @@ export class ClosingStockComponent implements OnInit {
|
||||
this.info.date = moment(formModel.date).format('DD-MMM-YYYY');
|
||||
const array = this.form.controls.stocks;
|
||||
this.info.items.forEach((item, index) => {
|
||||
item.physical = +array.controls[index].value.physical!;
|
||||
item.physical = +(array.controls[index].value.physical ?? '');
|
||||
item.costCentre =
|
||||
array.controls[index].value.costCentre == null
|
||||
? undefined
|
||||
@@ -132,7 +132,7 @@ export class ClosingStockComponent implements OnInit {
|
||||
|
||||
return new ClosingStock({
|
||||
date: moment(formModel.date).format('DD-MMM-YYYY'),
|
||||
costCentre: new CostCentre({ id: formModel.costCentre! }),
|
||||
costCentre: new CostCentre({ id: formModel.costCentre ?? '' }),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user