Chore: Reformatted everthing
Fix: Product ledger was not totalling. This is because for some reason, pydantic was sending the data as string when the field was nullable
This commit is contained in:
@@ -94,9 +94,7 @@ export class RecipeDetailComponent implements OnInit, AfterViewInit {
|
||||
map((x) => (x !== null && x.length >= 1 ? x : null)),
|
||||
debounceTime(150),
|
||||
distinctUntilChanged(),
|
||||
switchMap((x) =>
|
||||
x === null ? observableOf([]) : this.productSer.autocompleteProduct(x, null),
|
||||
),
|
||||
switchMap((x) => (x === null ? observableOf([]) : this.productSer.autocompleteProduct(x, null))),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -166,9 +164,7 @@ export class RecipeDetailComponent implements OnInit, AfterViewInit {
|
||||
if (this.ingredient === null || quantity <= 0 || rate <= 0) {
|
||||
return;
|
||||
}
|
||||
const oldFiltered = this.item.items.filter(
|
||||
(x) => x.product.id === (this.ingredient as ProductSku).id,
|
||||
);
|
||||
const oldFiltered = this.item.items.filter((x) => x.product.id === (this.ingredient as ProductSku).id);
|
||||
if (oldFiltered.length) {
|
||||
this.toaster.show('Danger', 'Product already added');
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user