fix: correct billing feature-store API paths and loyalty config
Some checks failed
Some checks failed
Fix feature-store.js calling /store/features/available instead of /store/billing/features/available (missing module prefix caused 404). Also handle platform-prefixed URLs in getStoreCode(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -88,7 +88,7 @@
|
||||
this.error = null;
|
||||
|
||||
// Fetch available features (lightweight endpoint)
|
||||
const response = await apiClient.get('/store/features/available');
|
||||
const response = await apiClient.get('/store/billing/features/available');
|
||||
|
||||
this.features = response.features || [];
|
||||
this.tierCode = response.tier_code;
|
||||
@@ -116,7 +116,7 @@
|
||||
if (!storeCode) return;
|
||||
|
||||
try {
|
||||
const response = await apiClient.get('/store/features');
|
||||
const response = await apiClient.get('/store/billing/features');
|
||||
|
||||
// Build map for quick lookup
|
||||
this.featuresMap = {};
|
||||
@@ -184,9 +184,15 @@
|
||||
getStoreCode() {
|
||||
const path = window.location.pathname;
|
||||
const segments = path.split('/').filter(Boolean);
|
||||
// Direct: /store/{code}/...
|
||||
if (segments[0] === 'store' && segments[1]) {
|
||||
return segments[1];
|
||||
}
|
||||
// Platform-prefixed: /platforms/{platform}/store/{code}/...
|
||||
const storeIdx = segments.indexOf('store');
|
||||
if (storeIdx !== -1 && segments[storeIdx + 1]) {
|
||||
return segments[storeIdx + 1];
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ class ModuleConfig(BaseSettings):
|
||||
# QR code settings
|
||||
qr_code_size: int = 300 # pixels
|
||||
|
||||
model_config = {"env_prefix": "LOYALTY_"}
|
||||
model_config = {"env_prefix": "LOYALTY_", "env_file": ".env", "extra": "ignore"}
|
||||
|
||||
|
||||
# Export for auto-discovery
|
||||
|
||||
Reference in New Issue
Block a user