Skip to content

Commit

Permalink
Remove trailing / from endpoints
Browse files Browse the repository at this point in the history
Getting 307 redirect errors when calling from Drupal.
  • Loading branch information
JimBacon committed Sep 24, 2024
1 parent ef1d225 commit b0ef693
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/user/user_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class UserPatch(BaseModel):
is_disabled: Optional[bool] = None


@router.get('/', summary="List users.", response_model=list[UserGet])
@router.get('', summary="List users.", response_model=list[UserGet])
async def read_users(db: DbDependency):
"""Get all users."""
users = db.exec(
Expand All @@ -68,7 +68,7 @@ async def read_user(db: DbDependency, username: str):
return user


@router.post('/', summary="Create user.", response_model=UserGet)
@router.post('', summary="Create user.", response_model=UserGet)
async def create_user(db: DbDependency, user_in: UserPost):
"""Create a new user."""
repo = UserRepo(db)
Expand Down
3 changes: 1 addition & 2 deletions app/validate/validate_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@
from .validate_models import Validate, Validated

router = APIRouter(
prefix="/validate",
tags=["Validate"],
dependencies=[Depends(get_current_user)]
)


@router.post(
"/",
"/validate",
summary="Validate records.",
response_model=list[Validated],
response_model_exclude_none=True)
Expand Down
3 changes: 1 addition & 2 deletions app/verify/verify_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@


router = APIRouter(
prefix="/verify",
tags=["Verify"],
dependencies=[Depends(get_current_user)]
)


@router.post(
"/",
"/verify",
summary="Verify records.",
response_model=VerifiedPack,
response_model_exclude_none=True)
Expand Down

0 comments on commit b0ef693

Please sign in to comment.