fix: add vendor page creation endpoint and update JS logic

- Add POST /admin/content-pages/vendor endpoint for vendor overrides
- Update JS to use /vendor or /platform endpoint based on vendor selection
- Platform endpoint forces vendor_id=None, vendor endpoint requires vendor_id

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-28 21:21:58 +01:00
parent 487d52f108
commit 2e5f50b6bd
2 changed files with 52 additions and 3 deletions

View File

@@ -163,10 +163,13 @@ function contentPageEditor(pageId) {
this.successMessage = 'Page updated successfully!';
contentPageEditLog.info('Page updated');
} else {
// Create new page
response = await apiClient.post('/admin/content-pages/platform', payload);
// Create new page - use vendor or platform endpoint based on selection
const endpoint = this.form.vendor_id
? '/admin/content-pages/vendor'
: '/admin/content-pages/platform';
response = await apiClient.post(endpoint, payload);
this.successMessage = 'Page created successfully!';
contentPageEditLog.info('Page created');
contentPageEditLog.info('Page created', { endpoint, vendor_id: this.form.vendor_id });
// Redirect to edit page after creation
const pageData = response.data || response;