fix: remove vendorCode from vendor API paths

Vendor API endpoints use JWT authentication, not URL path parameters.
The vendorCode should only be used for page URLs (navigation), not API calls.

Fixed API paths in 10 vendor JS files:
- analytics.js, customers.js, inventory.js, notifications.js
- order-detail.js, orders.js, products.js, profile.js
- settings.js, team.js

Added architecture rule JS-014 to prevent this pattern from recurring.
Added validation check _check_vendor_api_paths to validate_architecture.py.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-02 21:49:24 +01:00
parent c87bdfa129
commit 34d115dc58
12 changed files with 131 additions and 43 deletions

View File

@@ -107,7 +107,7 @@ function vendorAnalytics() {
*/
async fetchAnalytics() {
try {
const response = await apiClient.get(`/vendor/${this.vendorCode}/analytics?period=${this.period}`);
const response = await apiClient.get(`/vendor/analytics?period=${this.period}`);
return response;
} catch (error) {
// Analytics might require feature access
@@ -124,7 +124,7 @@ function vendorAnalytics() {
*/
async fetchStats() {
try {
const response = await apiClient.get(`/vendor/${this.vendorCode}/dashboard/stats`);
const response = await apiClient.get(`/vendor/dashboard/stats`);
return {
total_products: response.catalog?.total_products || 0,
active_products: response.catalog?.active_products || 0,