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

@@ -148,7 +148,7 @@ function vendorCustomers() {
params.append('status', this.filters.status);
}
const response = await apiClient.get(`/vendor/${this.vendorCode}/customers?${params.toString()}`);
const response = await apiClient.get(`/vendor/customers?${params.toString()}`);
this.customers = response.customers || [];
this.pagination.total = response.total || 0;
@@ -212,7 +212,7 @@ function vendorCustomers() {
async viewCustomer(customer) {
this.loading = true;
try {
const response = await apiClient.get(`/vendor/${this.vendorCode}/customers/${customer.id}`);
const response = await apiClient.get(`/vendor/customers/${customer.id}`);
this.selectedCustomer = response;
this.showDetailModal = true;
vendorCustomersLog.info('Loaded customer details:', customer.id);
@@ -230,7 +230,7 @@ function vendorCustomers() {
async viewCustomerOrders(customer) {
this.loading = true;
try {
const response = await apiClient.get(`/vendor/${this.vendorCode}/customers/${customer.id}/orders`);
const response = await apiClient.get(`/vendor/customers/${customer.id}/orders`);
this.selectedCustomer = customer;
this.customerOrders = response.orders || [];
this.showOrdersModal = true;