From 7d0874093cd783f2278d9c35a7fd786730c9f131 Mon Sep 17 00:00:00 2001 From: Amritanshu Date: Mon, 6 Mar 2023 21:42:09 +0530 Subject: [PATCH] Fix: New Product did not work due to missing quantity is the schema Fix: New Product would not auto add modifiers --- barker/barker/routers/product.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/barker/barker/routers/product.py b/barker/barker/routers/product.py index 528fc3d..0d145b3 100644 --- a/barker/barker/routers/product.py +++ b/barker/barker/routers/product.py @@ -124,7 +124,7 @@ def add_modifiers(product_id: uuid.UUID, menu_category_id: uuid.UUID, date_: dat categories = db.execute( select(count(ProductVersion.id), ModifierCategory.id) .join(Product.versions) - .join(ModifierCategoryProduct, ProductVersion.id == ModifierCategoryProduct.product_id) + .join(ModifierCategoryProduct, Product.id == ModifierCategoryProduct.product_id) .join(ModifierCategory, ModifierCategory.id == ModifierCategoryProduct.modifier_category_id) .where( and_( @@ -271,6 +271,7 @@ def show_blank( isNotAvailable=False, isActive=True, sortOrder=0, + quantity=0, )