refactor: remove legacy /shop and /api/v1/shop dead code
After the storefront migration, no live routes mount under /api/v1/shop/. Remove all dead code that detected/handled shop API requests: the is_shop_api_request() method, the shop API dispatch branch in middleware, the RequestContext.SHOP enum member (renamed to STOREFRONT), legacy path prefixes in FrontendDetector, and all associated tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -14,7 +14,7 @@ Migration guide:
|
||||
- RequestContext.API -> Check with FrontendDetector.is_api_request()
|
||||
- RequestContext.ADMIN -> FrontendType.ADMIN
|
||||
- RequestContext.STORE_DASHBOARD -> FrontendType.STORE
|
||||
- RequestContext.SHOP -> FrontendType.STOREFRONT
|
||||
- RequestContext.STOREFRONT -> FrontendType.STOREFRONT
|
||||
- RequestContext.FALLBACK -> FrontendType.PLATFORM (or handle API separately)
|
||||
|
||||
- get_request_context(request) -> get_frontend_type(request)
|
||||
@@ -44,14 +44,14 @@ class RequestContext(str, Enum):
|
||||
- API -> Use FrontendDetector.is_api_request() + FrontendType
|
||||
- ADMIN -> FrontendType.ADMIN
|
||||
- STORE_DASHBOARD -> FrontendType.STORE
|
||||
- SHOP -> FrontendType.STOREFRONT
|
||||
- STOREFRONT -> FrontendType.STOREFRONT
|
||||
- FALLBACK -> FrontendType.PLATFORM
|
||||
"""
|
||||
|
||||
API = "api"
|
||||
ADMIN = "admin"
|
||||
STORE_DASHBOARD = "store"
|
||||
SHOP = "shop"
|
||||
STOREFRONT = "storefront"
|
||||
FALLBACK = "fallback"
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ def get_request_context(request: Request) -> RequestContext:
|
||||
mapping = {
|
||||
FrontendType.ADMIN: RequestContext.ADMIN,
|
||||
FrontendType.STORE: RequestContext.STORE_DASHBOARD,
|
||||
FrontendType.STOREFRONT: RequestContext.SHOP,
|
||||
FrontendType.STOREFRONT: RequestContext.STOREFRONT,
|
||||
FrontendType.PLATFORM: RequestContext.FALLBACK,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user