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:
2023-08-04 21:00:26 +05:30
parent af27bf74ef
commit ac868257b7
194 changed files with 513 additions and 1580 deletions
@@ -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;