refactor: move vendor info endpoint to tenancy module
MIGRATION:
- Move app/api/v1/vendor/info.py to app/modules/tenancy/routes/api/vendor.py
- Change endpoint path from GET /{vendor_code} to GET /info/{vendor_code}
- Remove catch-all route ordering dependency
TENANCY MODULE SETUP:
- Mark tenancy module as is_self_contained=True
- Add routes/api/vendor.py with vendor_router
- Add exceptions.py with TenancyException hierarchy
- Add placeholder __init__.py files for services, models, schemas
FRONTEND UPDATES:
- Update static/vendor/js/login.js to use new /vendor/info/{vendor_code} path
- Update static/vendor/js/init-alpine.js to use new /vendor/info/{vendor_code} path
The new path is more explicit and eliminates the need for catch-all route
ordering in the vendor router aggregation.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
4
static/vendor/js/init-alpine.js
vendored
4
static/vendor/js/init-alpine.js
vendored
@@ -98,8 +98,8 @@ function data() {
|
||||
if (!this.vendorCode) return;
|
||||
|
||||
try {
|
||||
// apiClient prepends /api/v1, so /vendor/{code} → /api/v1/vendor/{code}
|
||||
const response = await apiClient.get(`/vendor/${this.vendorCode}`);
|
||||
// apiClient prepends /api/v1, so /vendor/info/{code} → /api/v1/vendor/info/{code}
|
||||
const response = await apiClient.get(`/vendor/info/${this.vendorCode}`);
|
||||
this.vendor = response;
|
||||
vendorLog.debug('Vendor info loaded', this.vendor);
|
||||
} catch (error) {
|
||||
|
||||
2
static/vendor/js/login.js
vendored
2
static/vendor/js/login.js
vendored
@@ -57,7 +57,7 @@ function vendorLogin() {
|
||||
vendorLoginLog.info('Loading vendor information...');
|
||||
this.loading = true;
|
||||
try {
|
||||
const response = await apiClient.get(`/vendor/${this.vendorCode}`);
|
||||
const response = await apiClient.get(`/vendor/info/${this.vendorCode}`);
|
||||
this.vendor = response;
|
||||
vendorLoginLog.info('Vendor loaded successfully:', {
|
||||
code: this.vendor.code,
|
||||
|
||||
Reference in New Issue
Block a user