Fix general settings route and req.user references

- Update frontend settings service to use correct /api/admin/settings/general route
- Fix all req.user to req.admin references in adminSettings.js
- Ensures settings can be saved without authentication errors
This commit is contained in:
2025-07-07 15:32:42 +02:00
parent f0768cd31b
commit 971397c338
20 changed files with 716 additions and 127 deletions
+3 -3
View File
@@ -86,7 +86,7 @@ router.post('/config', [
await logActivity('email_config_updated',
{ smtp_host, from_email },
null,
{ type: 'admin', id: req.user.id, name: req.user.username }
{ type: 'admin', id: req.admin.id, name: req.admin.username }
);
res.json({ message: 'Email configuration updated successfully' });
@@ -224,8 +224,8 @@ router.put('/templates/:key', [
await db('activity_logs').insert({
activity_type: 'email_template_updated',
actor_type: 'admin',
actor_id: req.user.id,
actor_name: req.user.username,
actor_id: req.admin.id,
actor_name: req.admin.username,
metadata: JSON.stringify({ template_key: req.params.key })
});