Skip to content

Commit

Permalink
fix: remove trailing slash in API endpoints (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Feb 29, 2024
1 parent e924d00 commit 31a840d
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions app/routers/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def get_current_session(
)


@auth_router.post("/")
@auth_router.post("")
def authentication(
form_data: Annotated[OAuth2PasswordRequestForm, Depends()],
response: Response,
Expand Down Expand Up @@ -111,15 +111,15 @@ def authentication(
)


@session_router.get("/", response_model=schemas.SessionBase)
@session_router.get("", response_model=schemas.SessionBase)
def get_user_session(
current_session: SessionModel = Depends(get_current_session),
):
"""Return information about the current user session."""
return current_session


@session_router.delete("/")
@session_router.delete("")
def delete_user_session(
current_session: SessionModel = Depends(get_current_session),
db: Session = Depends(get_db),
Expand Down
2 changes: 1 addition & 1 deletion app/routers/locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
router = APIRouter(prefix="/locations")


@router.get("/", response_model=Page[schemas.LocationFull])
@router.get("", response_model=Page[schemas.LocationFull])
def get_locations(
filters: schemas.LocationFilter = FilterDepends(schemas.LocationFilter),
db: Session = Depends(get_db),
Expand Down
4 changes: 2 additions & 2 deletions app/routers/prices.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def price_transformer(


@router.get(
"/",
"",
response_model=Page[schemas.PriceFullWithRelations],
)
def get_prices(
Expand All @@ -56,7 +56,7 @@ def get_prices(


@router.post(
"/",
"",
response_model=schemas.PriceFull,
status_code=status.HTTP_201_CREATED,
)
Expand Down
2 changes: 1 addition & 1 deletion app/routers/products.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
router = APIRouter(prefix="/products")


@router.get("/", response_model=Page[schemas.ProductFull])
@router.get("", response_model=Page[schemas.ProductFull])
def get_products(
filters: schemas.ProductFilter = FilterDepends(schemas.ProductFilter),
db: Session = Depends(get_db),
Expand Down
2 changes: 1 addition & 1 deletion app/routers/proofs.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
router = APIRouter(prefix="/proofs")


@router.get("/", response_model=Page[schemas.ProofFull])
@router.get("", response_model=Page[schemas.ProofFull])
def get_user_proofs(
current_user: schemas.UserCreate = Depends(get_current_user),
filters: schemas.ProofFilter = FilterDepends(schemas.ProofFilter),
Expand Down
2 changes: 1 addition & 1 deletion app/routers/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
router = APIRouter(prefix="/users")


@router.get("/", response_model=Page[schemas.UserBase])
@router.get("", response_model=Page[schemas.UserBase])
def get_users(
db: Session = Depends(get_db),
filters: schemas.UserFilter = FilterDepends(schemas.UserFilter),
Expand Down

0 comments on commit 31a840d

Please sign in to comment.