diff --git a/app/frontend/components/product/create_product.py b/app/frontend/components/product/create_product.py index f34f6cf89136f02e9a3a4fc3480b9dea880e1bd6..96f18b7b303d766745aa628252a7fb306e742841 100644 --- a/app/frontend/components/product/create_product.py +++ b/app/frontend/components/product/create_product.py @@ -56,18 +56,17 @@ def create_product_frame(parent, switch_func, API_URL, token): price_val = price_entry.get().strip() desc_val = desc_entry.get().strip() stock_val = stock_entry.get().strip() + # shop_val = shop_id_entry.get().strip() if not title_val or not price_val or not stock_val: messagebox.showerror("Error", "Title, Price, and Stock are required") return - # In a real scenario, you would pass the shop_id from view_shop. - # For now, use a placeholder shop_id (e.g., 1) data = { "name": title_val, "price": price_val, "description": desc_val, "stock": stock_val, - "shop_id": 1 # Replace with the actual shop id + # "shop_id": shop_val, } files = {} if os.path.isfile(image_path.get()): diff --git a/app/frontend/components/shop/create_shop.py b/app/frontend/components/shop/create_shop.py index 32cbf0de96fd909d60bbc626198cf6187acc2ccd..e0e4fa0d6b0ed3b463b94141f7f9a7f4a3fbc070 100644 --- a/app/frontend/components/shop/create_shop.py +++ b/app/frontend/components/shop/create_shop.py @@ -31,7 +31,6 @@ def create_shop_frame(parent, switch_func, API_URL, token): address_label = ctk.CTkLabel(frame, text="Address:") address_label.pack(pady=5) address_entry = ctk.CTkEntry(frame, width=300) - address_entry.insert(0, "123 Main St") address_entry.pack(pady=5) # Shop Image Upload @@ -76,7 +75,7 @@ def create_shop_frame(parent, switch_func, API_URL, token): if resp.status_code == 200: shop = resp.json() messagebox.showinfo("Success", "Shop created successfully!") - switch_func("view_shop", shop) # Pass the shop data to the view shop frame + switch_func("create_product", shop) # Pass the shop data to the view shop frame else: messagebox.showerror("Error", f"Failed to create shop. Status: {resp.status_code}\n{resp.text}") except Exception as e: