Remove trailing / from users endpoints

This commit is contained in:
Peter Vacho 2024-12-23 18:29:48 +01:00
parent fd3e355bfc
commit 3689f7d076
Signed by: school
GPG key ID: 8CFC3837052871B4

View file

@ -86,7 +86,7 @@ class UserUpdatable(BaseModel):
return updated, user
@public_router.post("/")
@public_router.post("")
async def register(reg_data: Annotated[RegisterData, Body()]) -> UserData:
"""Register a new user."""
user = await User.find_one(User.username == reg_data.username)
@ -99,7 +99,7 @@ async def register(reg_data: Annotated[RegisterData, Body()]) -> UserData:
return UserData.from_user(user)
@protected_router.get("/")
@protected_router.get("")
async def get_users() -> list[UserData]:
"""Get all registered users."""
users = await User.find_all().to_list()