Arafath10 commited on
Commit
50f144e
1 Parent(s): 5383d2f

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +6 -2
main.py CHANGED
@@ -1,4 +1,4 @@
1
- from fastapi import FastAPI, HTTPException
2
  from fastapi.responses import JSONResponse
3
  from fastapi.middleware.cors import CORSMiddleware
4
  import data_collector as dc
@@ -271,7 +271,11 @@ def find_related_products(sub_sku=None, product_name=None,forecast_data=None):
271
  return filtered_products
272
 
273
  @app.post("/search_results_from_DB")
274
- async def get_product_count_prediction_from_DB(b_id: int,search_sku:str,product_name:str):
 
 
 
 
275
  related_products = find_related_products(sub_sku=search_sku, product_name=product_name,forecast_data = get_data(b_id,1,2,True))
276
  response_content = {
277
  "status": "done",
 
1
+ from fastapi import FastAPI, HTTPException ,Query
2
  from fastapi.responses import JSONResponse
3
  from fastapi.middleware.cors import CORSMiddleware
4
  import data_collector as dc
 
271
  return filtered_products
272
 
273
  @app.post("/search_results_from_DB")
274
+ async def get_product_count_prediction_from_DB(
275
+ b_id: int,
276
+ search_sku: str = Query(None, description="The SKU of the product to search"),
277
+ product_name: str = Query(None, description="The name of the product to search"):
278
+
279
  related_products = find_related_products(sub_sku=search_sku, product_name=product_name,forecast_data = get_data(b_id,1,2,True))
280
  response_content = {
281
  "status": "done",