Fix: Save product for new product would bork as productGroup as null and not undefined.

This commit is contained in:
Amritanshu Agrawal 2020-12-12 10:26:12 +05:30
parent 24ea8096c4
commit 184dca62f6

View File

@ -128,7 +128,7 @@ export class ProductDetailComponent implements OnInit, AfterViewInit {
this.item.isPurchased = formModel.isPurchased;
this.item.isSold = formModel.isSold;
this.item.isActive = formModel.isActive;
if (this.item.productGroup === undefined) {
if (this.item.productGroup === null || this.item.productGroup === undefined) {
this.item.productGroup = new ProductGroup();
}
this.item.productGroup.id = formModel.productGroup;