Add endpoint for creating local contacts with access control
Introduced a new `local_contact_router` to handle creation of local contacts. The endpoint enforces role-based access control and ensures no duplication of email addresses. Updated the router exports for consistency and cleaned up a large test file to improve readability.
This commit is contained in:
@ -5,6 +5,7 @@ from app.routers.address import address_router
|
||||
from app.routers.contact import contact_router
|
||||
from app.routers.shipment import shipment_router
|
||||
from app.routers.dewar import dewar_router
|
||||
from app.routers.local_contact import local_contact_router
|
||||
|
||||
protected_router = APIRouter(
|
||||
dependencies=[Depends(get_current_user)] # Applies to all routes
|
||||
@ -12,6 +13,9 @@ protected_router = APIRouter(
|
||||
|
||||
protected_router.include_router(address_router, prefix="/addresses", tags=["addresses"])
|
||||
protected_router.include_router(contact_router, prefix="/contacts", tags=["contacts"])
|
||||
protected_router.include_router(
|
||||
local_contact_router, prefix="/local-contacts", tags=["local-contacts"]
|
||||
)
|
||||
protected_router.include_router(
|
||||
shipment_router, prefix="/shipments", tags=["shipments"]
|
||||
)
|
||||
|
Reference in New Issue
Block a user