Chore: Just made it look nicer
This commit is contained in:
@@ -113,22 +113,22 @@ export class ProductDetailComponent implements OnInit, AfterViewInit {
|
||||
if (formValue === undefined) {
|
||||
return;
|
||||
}
|
||||
const fraction = +(formValue.fraction ?? '0');
|
||||
const fraction = Number(formValue.fraction);
|
||||
if (fraction < 1) {
|
||||
this.toaster.show('Danger', 'Fraction has to be >= 1');
|
||||
return;
|
||||
}
|
||||
const productYield = +(formValue.productYield ?? '0');
|
||||
const productYield = Number(formValue.productYield);
|
||||
if (productYield < 0 || productYield > 1) {
|
||||
this.toaster.show('Danger', 'Product Yield has to be > 0 and <= 1');
|
||||
return;
|
||||
}
|
||||
const costPrice = +(formValue.costPrice ?? '0');
|
||||
const costPrice = Number(formValue.costPrice);
|
||||
if (costPrice < 0) {
|
||||
this.toaster.show('Danger', 'Price has to be >= 0');
|
||||
return;
|
||||
}
|
||||
const salePrice = +(formValue.salePrice ?? '0');
|
||||
const salePrice = Number(formValue.salePrice);
|
||||
if (salePrice < 0) {
|
||||
this.toaster.show('Danger', 'Sale Price has to be >= 0');
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user