Debug: Notification config save/toggle logging

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Daniel 2026-03-08 20:24:50 +01:00
parent 1d409af0ee
commit 34e193fb92
2 changed files with 3 additions and 0 deletions

View file

@ -224,6 +224,7 @@ const notificationsPlugin: Plugin = {
// Save config // Save config
app.post('/api/notifications/config', requireAdmin, (req, res) => { app.post('/api/notifications/config', requireAdmin, (req, res) => {
console.log(`${NB} Save request body:`, JSON.stringify(req.body));
const { channels } = req.body ?? {}; const { channels } = req.body ?? {};
if (!Array.isArray(channels)) { res.status(400).json({ error: 'channels array erforderlich' }); return; } if (!Array.isArray(channels)) { res.status(400).json({ error: 'channels array erforderlich' }); return; }
// Validate each channel config // Validate each channel config

View file

@ -613,6 +613,7 @@ export default function StreamingTab({ data }: { data: any }) {
}, [isAdmin, loadNotifyConfig]); }, [isAdmin, loadNotifyConfig]);
const toggleChannelEvent = useCallback((channelId: string, channelName: string, guildId: string, guildName: string, event: string) => { const toggleChannelEvent = useCallback((channelId: string, channelName: string, guildId: string, guildName: string, event: string) => {
console.log('[Notifications] Toggle:', channelId, channelName, event);
setNotifyConfig(prev => { setNotifyConfig(prev => {
const existing = prev.find(c => c.channelId === channelId); const existing = prev.find(c => c.channelId === channelId);
if (existing) { if (existing) {
@ -631,6 +632,7 @@ export default function StreamingTab({ data }: { data: any }) {
}, []); }, []);
const saveNotifyConfig = useCallback(async () => { const saveNotifyConfig = useCallback(async () => {
console.log('[Notifications] Saving config, notifyConfig:', JSON.stringify(notifyConfig));
setConfigSaving(true); setConfigSaving(true);
try { try {
const resp = await fetch('/api/notifications/config', { const resp = await fetch('/api/notifications/config', {