2012b0bab9
- Added default_language field to general settings state in SettingsPage - Replaced LanguageSelector component with simple select dropdown on settings page - Fixed public settings endpoint to read general_default_language from database - Language setting now properly saved when clicking Save Settings button - Setting is correctly used by gallery login page and legal pages 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
37 lines
1.1 KiB
JavaScript
37 lines
1.1 KiB
JavaScript
const path = require('path');
|
|
require('dotenv').config({ path: path.join(__dirname, '../.env') });
|
|
const { db } = require('../src/database/db');
|
|
|
|
async function fixDefaultThemes() {
|
|
try {
|
|
console.log('Fixing events with "default" theme...');
|
|
|
|
// Find all events with "default" as color_theme
|
|
const eventsToFix = await db('events')
|
|
.where('color_theme', 'default')
|
|
.select('id', 'event_name');
|
|
|
|
console.log(`Found ${eventsToFix.length} events to fix`);
|
|
|
|
if (eventsToFix.length > 0) {
|
|
// Update them to null so they use the global theme
|
|
await db('events')
|
|
.where('color_theme', 'default')
|
|
.update({ color_theme: null });
|
|
|
|
console.log('Updated events to use global theme');
|
|
|
|
eventsToFix.forEach(event => {
|
|
console.log(`- Fixed event: ${event.event_name} (ID: ${event.id})`);
|
|
});
|
|
}
|
|
|
|
console.log('Theme fix completed successfully');
|
|
process.exit(0);
|
|
} catch (error) {
|
|
console.error('Error fixing themes:', error);
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
fixDefaultThemes(); |