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:
16
static/vendor/js/order-detail.js
vendored
16
static/vendor/js/order-detail.js
vendored
@@ -94,7 +94,7 @@ function vendorOrderDetail() {
|
||||
try {
|
||||
// Load order details
|
||||
const orderResponse = await apiClient.get(
|
||||
`/vendor/${this.vendorCode}/orders/${this.orderId}`
|
||||
`/vendor/orders/${this.orderId}`
|
||||
);
|
||||
this.order = orderResponse;
|
||||
this.newStatus = this.order.status;
|
||||
@@ -121,7 +121,7 @@ function vendorOrderDetail() {
|
||||
async loadShipmentStatus() {
|
||||
try {
|
||||
const response = await apiClient.get(
|
||||
`/vendor/${this.vendorCode}/orders/${this.orderId}/shipment-status`
|
||||
`/vendor/orders/${this.orderId}/shipment-status`
|
||||
);
|
||||
this.shipmentStatus = response;
|
||||
orderDetailLog.info('Loaded shipment status:', response);
|
||||
@@ -138,7 +138,7 @@ function vendorOrderDetail() {
|
||||
try {
|
||||
// Search for invoices linked to this order
|
||||
const response = await apiClient.get(
|
||||
`/vendor/${this.vendorCode}/invoices?order_id=${this.orderId}&limit=1`
|
||||
`/vendor/invoices?order_id=${this.orderId}&limit=1`
|
||||
);
|
||||
if (response.invoices && response.invoices.length > 0) {
|
||||
this.invoice = response.invoices[0];
|
||||
@@ -223,7 +223,7 @@ function vendorOrderDetail() {
|
||||
}
|
||||
|
||||
await apiClient.put(
|
||||
`/vendor/${this.vendorCode}/orders/${this.orderId}/status`,
|
||||
`/vendor/orders/${this.orderId}/status`,
|
||||
payload
|
||||
);
|
||||
|
||||
@@ -255,7 +255,7 @@ function vendorOrderDetail() {
|
||||
this.saving = true;
|
||||
try {
|
||||
await apiClient.post(
|
||||
`/vendor/${this.vendorCode}/orders/${this.orderId}/items/${itemId}/ship`,
|
||||
`/vendor/orders/${this.orderId}/items/${itemId}/ship`,
|
||||
{}
|
||||
);
|
||||
|
||||
@@ -281,7 +281,7 @@ function vendorOrderDetail() {
|
||||
|
||||
for (const item of unshippedItems) {
|
||||
await apiClient.post(
|
||||
`/vendor/${this.vendorCode}/orders/${this.orderId}/items/${item.item_id}/ship`,
|
||||
`/vendor/orders/${this.orderId}/items/${item.item_id}/ship`,
|
||||
{}
|
||||
);
|
||||
}
|
||||
@@ -294,7 +294,7 @@ function vendorOrderDetail() {
|
||||
}
|
||||
|
||||
await apiClient.put(
|
||||
`/vendor/${this.vendorCode}/orders/${this.orderId}/status`,
|
||||
`/vendor/orders/${this.orderId}/status`,
|
||||
payload
|
||||
);
|
||||
|
||||
@@ -319,7 +319,7 @@ function vendorOrderDetail() {
|
||||
this.creatingInvoice = true;
|
||||
try {
|
||||
const response = await apiClient.post(
|
||||
`/vendor/${this.vendorCode}/invoices`,
|
||||
`/vendor/invoices`,
|
||||
{ order_id: this.orderId }
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user