Skip to content

Commit

Permalink
🎨 Move prefix and tags to routers (#1439)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick91 authored Dec 2, 2024
1 parent aa71abe commit 3083207
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions backend/app/api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
from app.core.config import settings

api_router = APIRouter()
api_router.include_router(login.router, tags=["login"])
api_router.include_router(users.router, prefix="/users", tags=["users"])
api_router.include_router(utils.router, prefix="/utils", tags=["utils"])
api_router.include_router(items.router, prefix="/items", tags=["items"])
api_router.include_router(login.router)
api_router.include_router(users.router)
api_router.include_router(utils.router)
api_router.include_router(items.router)


if settings.ENVIRONMENT == "local":
Expand Down
2 changes: 1 addition & 1 deletion backend/app/api/routes/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from app.api.deps import CurrentUser, SessionDep
from app.models import Item, ItemCreate, ItemPublic, ItemsPublic, ItemUpdate, Message

router = APIRouter()
router = APIRouter(prefix="/items", tags=["items"])


@router.get("/", response_model=ItemsPublic)
Expand Down
2 changes: 1 addition & 1 deletion backend/app/api/routes/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
verify_password_reset_token,
)

router = APIRouter()
router = APIRouter(tags=["login"])


@router.post("/login/access-token")
Expand Down
2 changes: 1 addition & 1 deletion backend/app/api/routes/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
)
from app.utils import generate_new_account_email, send_email

router = APIRouter()
router = APIRouter(prefix="/users", tags=["users"])


@router.get(
Expand Down
2 changes: 1 addition & 1 deletion backend/app/api/routes/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from app.models import Message
from app.utils import generate_test_email, send_email

router = APIRouter()
router = APIRouter(prefix="/utils", tags=["utils"])


@router.post(
Expand Down

0 comments on commit 3083207

Please sign in to comment.