Ajit Panday commited on
Commit
0e10f98
·
1 Parent(s): 2077967

Update all database session dependencies to use get_db

Browse files
Files changed (1) hide show
  1. main.py +3 -3
main.py CHANGED
@@ -66,7 +66,7 @@ async def process_call(
66
  caller_number: str = Form(...),
67
  called_number: str = Form(...),
68
  customer: Customer = Depends(verify_api_key),
69
- db: Session = Depends(Customer.get_db)
70
  ):
71
  """
72
  Process a voice call recording file.
@@ -138,7 +138,7 @@ async def process_call(
138
  @app.get("/api/v1/calls/{customer_id}")
139
  async def list_calls(
140
  customer_id: int,
141
- db: Session = Depends(Customer.get_db),
142
  current_admin: str = Depends(get_current_admin)
143
  ):
144
  """
@@ -182,7 +182,7 @@ async def login_for_access_token(form_data: OAuth2PasswordRequestForm = Depends(
182
  @app.post("/api/v1/customers/", response_model=Customer)
183
  async def create_customer(
184
  customer: Customer,
185
- db: Session = Depends(Customer.get_db),
186
  current_admin: str = Depends(get_current_admin)
187
  ):
188
  """Create new customer"""
 
66
  caller_number: str = Form(...),
67
  called_number: str = Form(...),
68
  customer: Customer = Depends(verify_api_key),
69
+ db: Session = Depends(get_db)
70
  ):
71
  """
72
  Process a voice call recording file.
 
138
  @app.get("/api/v1/calls/{customer_id}")
139
  async def list_calls(
140
  customer_id: int,
141
+ db: Session = Depends(get_db),
142
  current_admin: str = Depends(get_current_admin)
143
  ):
144
  """
 
182
  @app.post("/api/v1/customers/", response_model=Customer)
183
  async def create_customer(
184
  customer: Customer,
185
+ db: Session = Depends(get_db),
186
  current_admin: str = Depends(get_current_admin)
187
  ):
188
  """Create new customer"""