fix: resolve architecture validation errors
- Create platform_service.py to move DB queries from platforms.py API - Create platform.py exceptions for PlatformNotFoundException - Update platforms.py API to use platform_service - Update vendor/content_pages.py to use vendor_service - Add get_vendor_by_id_optional method to VendorService - Fix platforms.js: add centralized logger and init guard - Fix content-page-edit.html: use modal macro instead of inline modal All 21 architecture validation errors resolved. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
* Handles platform listing and management for multi-platform CMS.
|
||||
*/
|
||||
|
||||
const platformsLog = window.LogConfig.createLogger('PLATFORMS');
|
||||
|
||||
function platformsManager() {
|
||||
return {
|
||||
// State
|
||||
@@ -13,6 +15,10 @@ function platformsManager() {
|
||||
|
||||
// Lifecycle
|
||||
async init() {
|
||||
// Duplicate initialization guard
|
||||
if (window._adminPlatformsInitialized) return;
|
||||
window._adminPlatformsInitialized = true;
|
||||
|
||||
this.currentPage = "platforms";
|
||||
await this.loadPlatforms();
|
||||
},
|
||||
@@ -25,9 +31,9 @@ function platformsManager() {
|
||||
try {
|
||||
const response = await apiClient.get("/admin/platforms");
|
||||
this.platforms = response.platforms || [];
|
||||
console.log(`[PLATFORMS] Loaded ${this.platforms.length} platforms`);
|
||||
platformsLog.info(`Loaded ${this.platforms.length} platforms`);
|
||||
} catch (err) {
|
||||
console.error("[PLATFORMS] Error loading platforms:", err);
|
||||
platformsLog.error("Error loading platforms:", err);
|
||||
this.error = err.message || "Failed to load platforms";
|
||||
} finally {
|
||||
this.loading = false;
|
||||
|
||||
Reference in New Issue
Block a user