Skip to content

Commit 95408e0

Browse files
committed
Update import router
1 parent 539cc30 commit 95408e0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/python_template/api/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from fastapi import FastAPI
55

66
from python_template.api.dependency_container import DependencyContainer
7-
from python_template.api.workflows.products import product_router
7+
from python_template.api.workflows.products.product_router import product_router
88
from python_template.common.application_environment import ApplicationEnvironment
99

1010

@@ -24,4 +24,4 @@ async def lifespan(_: FastAPI) -> AsyncGenerator[None]:
2424
openapi_url=openapi_url,
2525
lifespan=lifespan,
2626
)
27-
app.include_router(product_router.router)
27+
app.include_router(product_router)

src/python_template/api/workflows/products/product_router.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@
1111
PublishProductResponse,
1212
)
1313

14-
router = APIRouter(
14+
product_router = APIRouter(
1515
prefix="/api/v1/products",
1616
tags=["products"],
1717
)
1818

1919

20-
@router.post("")
20+
@product_router.post("")
2121
async def publish_product(request: PublishProductRequest) -> PublishProductResponse:
2222
workflow = await DependencyContainer.get_publish_product_workflow()
2323
return await workflow.execute(request)
2424

2525

26-
@router.post("/discontinue")
26+
@product_router.post("/discontinue")
2727
async def discontinue_product(request: DiscontinueProductRequest) -> None:
2828
workflow = await DependencyContainer.get_discontinue_product_workflow()
2929
await workflow.execute(request)

0 commit comments

Comments
 (0)