Skip to content

Commit

Permalink
Remove async (not supported yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Nov 22, 2023
1 parent 959455c commit 6ed7b7e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def main_page(request: Request):


@app.post("/auth")
async def authentication(
def authentication(
form_data: Annotated[OAuth2PasswordRequestForm, Depends()],
db: Session = Depends(get_db),
):
Expand Down Expand Up @@ -134,15 +134,15 @@ async def authentication(


@app.get("/prices", response_model=Page[schemas.PriceBase])
async def get_price(
def get_price(
filters: schemas.PriceFilter = FilterDepends(schemas.PriceFilter),
db: Session = Depends(get_db),
):
return paginate(db, crud.get_prices_query(filters=filters))


@app.post("/prices", response_model=schemas.PriceBase)
async def create_price(
def create_price(
price: schemas.PriceCreate,
background_tasks: BackgroundTasks,
current_user: schemas.UserBase = Depends(get_current_user),
Expand Down Expand Up @@ -209,7 +209,7 @@ def get_user_proofs(


@app.get("/products/{product_id}", response_model=schemas.ProductBase)
async def get_product(product_id: int, db: Session = Depends(get_db)):
def get_product(product_id: int, db: Session = Depends(get_db)):
db_product = crud.get_product_by_id(db, id=product_id)
if not db_product:
raise HTTPException(
Expand All @@ -220,7 +220,7 @@ async def get_product(product_id: int, db: Session = Depends(get_db)):


@app.get("/locations/{location_id}", response_model=schemas.LocationBase)
async def get_location(location_id: int, db: Session = Depends(get_db)):
def get_location(location_id: int, db: Session = Depends(get_db)):
db_location = crud.get_location_by_id(db, id=location_id)
if not db_location:
raise HTTPException(
Expand All @@ -231,7 +231,7 @@ async def get_location(location_id: int, db: Session = Depends(get_db)):


@app.get("/status")
async def status_endpoint():
def status_endpoint():
return {"status": "running"}


Expand Down

0 comments on commit 6ed7b7e

Please sign in to comment.