feat: require auth to add players/teams
This commit is contained in:
parent
a46427c6b8
commit
a52dae5605
14
main.py
14
main.py
@ -66,11 +66,21 @@ def list_teams():
|
|||||||
|
|
||||||
player_router = APIRouter(prefix="/player")
|
player_router = APIRouter(prefix="/player")
|
||||||
player_router.add_api_route("/list", endpoint=list_players, methods=["GET"])
|
player_router.add_api_route("/list", endpoint=list_players, methods=["GET"])
|
||||||
player_router.add_api_route("/add", endpoint=add_player, methods=["POST"])
|
player_router.add_api_route(
|
||||||
|
"/add",
|
||||||
|
endpoint=add_player,
|
||||||
|
methods=["POST"],
|
||||||
|
dependencies=[Depends(get_current_active_user)],
|
||||||
|
)
|
||||||
|
|
||||||
team_router = APIRouter(prefix="/team")
|
team_router = APIRouter(prefix="/team")
|
||||||
team_router.add_api_route("/list", endpoint=list_teams, methods=["GET"])
|
team_router.add_api_route("/list", endpoint=list_teams, methods=["GET"])
|
||||||
team_router.add_api_route("/add", endpoint=add_team, methods=["POST"])
|
team_router.add_api_route(
|
||||||
|
"/add",
|
||||||
|
endpoint=add_team,
|
||||||
|
methods=["POST"],
|
||||||
|
dependencies=[Depends(get_current_active_user)],
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.post("/mvps/", status_code=status.HTTP_200_OK)
|
@app.post("/mvps/", status_code=status.HTTP_200_OK)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user