From 81cf84ed28fd2f3951fd394a5db54e4f148b17f3 Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Tue, 24 Feb 2026 22:01:03 +0100 Subject: [PATCH] fix: correct billing feature-store API paths and loyalty config 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 --- app/modules/billing/static/shared/js/feature-store.js | 10 ++++++++-- app/modules/loyalty/config.py | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/modules/billing/static/shared/js/feature-store.js b/app/modules/billing/static/shared/js/feature-store.js index e92f0fcc..305b1abb 100644 --- a/app/modules/billing/static/shared/js/feature-store.js +++ b/app/modules/billing/static/shared/js/feature-store.js @@ -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; }, diff --git a/app/modules/loyalty/config.py b/app/modules/loyalty/config.py index d8297eb3..0aa1438f 100644 --- a/app/modules/loyalty/config.py +++ b/app/modules/loyalty/config.py @@ -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