feat: add vendor dropdown and show_in_legal to content page editor
- Load vendors dynamically in content page editor dropdown - Add show_in_legal field to default content pages seed script - Set privacy and terms pages to show_in_legal=true, show_in_footer=false - Update page creation in seed script to use show_in_legal 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -31,7 +31,9 @@ function contentPageEditor(pageId) {
|
||||
display_order: 0,
|
||||
vendor_id: null
|
||||
},
|
||||
vendors: [],
|
||||
loading: false,
|
||||
loadingVendors: false,
|
||||
saving: false,
|
||||
error: null,
|
||||
successMessage: null,
|
||||
@@ -48,6 +50,9 @@ function contentPageEditor(pageId) {
|
||||
}
|
||||
window._contentPageEditInitialized = true;
|
||||
|
||||
// Load vendors for dropdown
|
||||
await this.loadVendors();
|
||||
|
||||
if (this.pageId) {
|
||||
// Edit mode - load existing page
|
||||
contentPageEditLog.group('Loading page for editing');
|
||||
@@ -61,6 +66,23 @@ function contentPageEditor(pageId) {
|
||||
contentPageEditLog.info('=== CONTENT PAGE EDITOR INITIALIZATION COMPLETE ===');
|
||||
},
|
||||
|
||||
// Load vendors for dropdown
|
||||
async loadVendors() {
|
||||
this.loadingVendors = true;
|
||||
try {
|
||||
contentPageEditLog.info('Loading vendors...');
|
||||
const response = await apiClient.get('/admin/vendors?is_active=true&limit=100');
|
||||
const data = response.data || response;
|
||||
this.vendors = data.items || data || [];
|
||||
contentPageEditLog.info(`Loaded ${this.vendors.length} vendors`);
|
||||
} catch (err) {
|
||||
contentPageEditLog.error('Error loading vendors:', err);
|
||||
this.vendors = [];
|
||||
} finally {
|
||||
this.loadingVendors = false;
|
||||
}
|
||||
},
|
||||
|
||||
// Load existing page
|
||||
async loadPage() {
|
||||
this.loading = true;
|
||||
|
||||
Reference in New Issue
Block a user