Debug: Notification config save/toggle logging
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
1d409af0ee
commit
34e193fb92
2 changed files with 3 additions and 0 deletions
|
|
@ -224,6 +224,7 @@ const notificationsPlugin: Plugin = {
|
|||
|
||||
// Save config
|
||||
app.post('/api/notifications/config', requireAdmin, (req, res) => {
|
||||
console.log(`${NB} Save request body:`, JSON.stringify(req.body));
|
||||
const { channels } = req.body ?? {};
|
||||
if (!Array.isArray(channels)) { res.status(400).json({ error: 'channels array erforderlich' }); return; }
|
||||
// Validate each channel config
|
||||
|
|
|
|||
|
|
@ -613,6 +613,7 @@ export default function StreamingTab({ data }: { data: any }) {
|
|||
}, [isAdmin, loadNotifyConfig]);
|
||||
|
||||
const toggleChannelEvent = useCallback((channelId: string, channelName: string, guildId: string, guildName: string, event: string) => {
|
||||
console.log('[Notifications] Toggle:', channelId, channelName, event);
|
||||
setNotifyConfig(prev => {
|
||||
const existing = prev.find(c => c.channelId === channelId);
|
||||
if (existing) {
|
||||
|
|
@ -631,6 +632,7 @@ export default function StreamingTab({ data }: { data: any }) {
|
|||
}, []);
|
||||
|
||||
const saveNotifyConfig = useCallback(async () => {
|
||||
console.log('[Notifications] Saving config, notifyConfig:', JSON.stringify(notifyConfig));
|
||||
setConfigSaving(true);
|
||||
try {
|
||||
const resp = await fetch('/api/notifications/config', {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue