Skip to content

Commit

Permalink
fix: error in initialization of supabase client
Browse files Browse the repository at this point in the history
  • Loading branch information
AshminJayson committed Sep 23, 2023
1 parent d85d680 commit 51941fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ async def add_improve_top_product_sales(product_name: str):
res = gpt.improve_top_product_sales(product_name)
return {'strategy': res}


@app.get('/improve_low_product_sales')
async def add_improve_low_product_sales(product_name: str):
res = gpt.improve_low_product_sales(product_name)
Expand Down
3 changes: 3 additions & 0 deletions store/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ def init_client():


def get_all_shops_of_user(user_id):
init_client()
shop_records = supabase.table('shop').select("*").eq('user_id', user_id).execute()
return shop_records.data

def get_all_shops():
init_client()
shop_records = supabase.table('shop').select('*').execute()
return shop_records.data

Expand All @@ -39,6 +41,7 @@ def get_all_transactions_of_shop(shop_id):


def get_all_users():
init_client()
user_records = supabase.table('user').select("*").execute()
return user_records.data

Expand Down

0 comments on commit 51941fb

Please sign in to comment.