Fix multiple production issues and add password change functionality

- Fixed frontend API URL configuration to use correct port 3002
- Fixed create event functionality by adding proper endpoint and fixing JSON parsing
- Fixed email settings save functionality by importing logActivity correctly
- Fixed admin settings save functionality by using api client instead of direct fetch
- Implemented password change functionality with modal and backend endpoint
- Added updated_at column to admin_users table
- Fixed all mock data issues - now using real backend data throughout

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-07-07 10:25:38 +02:00
parent f38a8ef598
commit 225d017718
16 changed files with 495 additions and 82 deletions
+6 -8
View File
@@ -1,7 +1,7 @@
const express = require('express');
const nodemailer = require('nodemailer');
const { body, validationResult } = require('express-validator');
const { db } = require('../database/db');
const { db, logActivity } = require('../database/db');
const { adminAuth } = require('../middleware/auth');
const router = express.Router();
@@ -83,13 +83,11 @@ router.post('/config', [
}
// Log activity
await db('activity_logs').insert({
activity_type: 'email_config_updated',
actor_type: 'admin',
actor_id: req.user.id,
actor_name: req.user.username,
metadata: JSON.stringify({ smtp_host, from_email })
});
await logActivity('email_config_updated',
{ smtp_host, from_email },
null,
{ type: 'admin', id: req.user.id, name: req.user.username }
);
res.json({ message: 'Email configuration updated successfully' });
} catch (error) {