Skip to content

Commit

Permalink
paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Furrior committed Feb 1, 2025
1 parent ae9b0bf commit 0026c9d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/routes/v1/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async def callback(session: SessionDep, code: str, state: str) -> Player:


@router.get(
"/",
"",
status_code=status.HTTP_200_OK,
responses={
status.HTTP_200_OK: {"description": "Player"},
Expand Down Expand Up @@ -135,7 +135,7 @@ async def get_player(session: SessionDep,
# /players/


@router.get("s/", status_code=status.HTTP_200_OK)
@router.get("s", status_code=status.HTTP_200_OK)
async def get_players(session: SessionDep, request: Request, page: int = 1, page_size: int = 50) -> PaginatedResponse[Player]:
total = session.exec(select(func.count()).select_from( # pylint: disable=not-callable # black magic
Player)).first()
Expand Down
10 changes: 5 additions & 5 deletions app/routes/v1/wl/whitelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
logger = logging.getLogger(__name__)

router = APIRouter(prefix="/whitelist", tags=["Whitelist"])
ban_router = APIRouter(prefix="/ban", tags=["Whitelist", "Ban"])
ban_router = APIRouter(prefix="/ban", tags=["Whitelist Ban", "Ban"])


def select_only_active_whitelists(selection: SelectOfScalar[Whitelist]):
Expand Down Expand Up @@ -97,7 +97,7 @@ def paginate_selection(session: SessionDep,
current_url=request.url,
)

@router.get("s/", # /whitelists
@router.get("s", # /whitelists
status_code=status.HTTP_200_OK,
responses={
status.HTTP_200_OK: {"description": "List of matching whitelists"},
Expand All @@ -119,7 +119,7 @@ async def get_whitelists(session: SessionDep,
return paginate_selection(session, selection, request, page, page_size)


@router.get("/ckeys/",
@router.get("/ckeys",
status_code=status.HTTP_200_OK,
responses={
status.HTTP_200_OK: {"description": "Whitelistd ckeys"},
Expand Down Expand Up @@ -217,7 +217,7 @@ def create_ban_helper(session: SessionDep,
logger.info("Whitelist ban created: %s", ban.model_dump_json())
return ban

@ban_router.get("s/", status_code=status.HTTP_200_OK)
@ban_router.get("s", status_code=status.HTTP_200_OK)
async def get_whitelist_bans(session: SessionDep,
request: Request,
ckey: str | None = None,
Expand Down Expand Up @@ -250,7 +250,7 @@ async def get_whitelist_bans(session: SessionDep,
current_url=request.url,
)

@ban_router.post("/", status_code=status.HTTP_201_CREATED, responses=BAN_POST_RESPONSES, dependencies=[Depends(verify_bearer)])
@ban_router.post("", status_code=status.HTTP_201_CREATED, responses=BAN_POST_RESPONSES, dependencies=[Depends(verify_bearer)])
async def create_whitelist_ban(session: SessionDep, new_ban: NewWhitelistBanInternal, invalidate_wls: bool = True) -> WhitelistBan:
return create_ban_helper(
session,
Expand Down

0 comments on commit 0026c9d

Please sign in to comment.