Improve the frontend and fix TODOs
This commit is contained in:
@@ -326,14 +326,16 @@ async def proxy_tenant_procurement(request: Request, tenant_id: str = Path(...),
|
||||
# TENANT-SCOPED SUPPLIER SERVICE ENDPOINTS
|
||||
# ================================================================
|
||||
|
||||
@router.api_route("/{tenant_id}/suppliers/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"])
|
||||
@router.api_route("/{tenant_id}/suppliers", methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"])
|
||||
async def proxy_tenant_suppliers(request: Request, tenant_id: str = Path(...), path: str = ""):
|
||||
"""Proxy tenant supplier requests to suppliers service"""
|
||||
if path:
|
||||
target_path = f"/api/v1/tenants/{tenant_id}/suppliers/{path}".rstrip("/")
|
||||
else:
|
||||
target_path = f"/api/v1/tenants/{tenant_id}/suppliers"
|
||||
async def proxy_tenant_suppliers_base(request: Request, tenant_id: str = Path(...)):
|
||||
"""Proxy tenant supplier requests to suppliers service (base path)"""
|
||||
target_path = f"/api/v1/tenants/{tenant_id}/suppliers"
|
||||
return await _proxy_to_suppliers_service(request, target_path, tenant_id=tenant_id)
|
||||
|
||||
@router.api_route("/{tenant_id}/suppliers/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"])
|
||||
async def proxy_tenant_suppliers_with_path(request: Request, tenant_id: str = Path(...), path: str = ""):
|
||||
"""Proxy tenant supplier requests to suppliers service (with additional path)"""
|
||||
target_path = f"/api/v1/tenants/{tenant_id}/suppliers/{path}".rstrip("/")
|
||||
return await _proxy_to_suppliers_service(request, target_path, tenant_id=tenant_id)
|
||||
|
||||
@router.api_route("/{tenant_id}/purchase-orders{path:path}", methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"])
|
||||
|
||||
Reference in New Issue
Block a user