fix(backend): wire mobile settings screen to notification preferences API

The mobile app's settingsService.getNotificationPreferences/
updateNotificationPreferences call GET/PUT /api/v1/settings/notifications,
but the backend never registered any /settings/* routes — only
/api/v1/notifications/preferences existed. Every load silently 404'd
(swallowed by a catch that just logs) and every Save showed a "Failed
to save settings" alert; no notification preference was ever read back
or persisted for any user.

Mount the existing, already-working notificationPreferencesRoutes router
at /api/v1/settings/notifications as well, so the mobile client actually
reaches the real controller/Prisma logic instead of hitting a dead path.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
caelum0x 2026-10-18 00:36:20 +03:00
parent 4bdaf40d26
commit 125baca2db

View File

@ -286,6 +286,12 @@ app.use('/api/v1/notifications', notificationRoutes);
// Notification preferences routes
app.use('/api/v1/notifications/preferences', notificationPreferencesRoutes);
// Alias: the mobile app's settingsService calls GET/PUT /settings/notifications,
// which never had a matching route — every load/save silently 404'd and no
// preference was ever persisted or read back. Mount the same, already-working
// preferences router here too so that client actually reaches real logic.
app.use('/api/v1/settings/notifications', notificationPreferencesRoutes);
// Muted words / tags routes (per-user keyword muting)
app.use('/api/v1/muted-words', mutedWordsRoutes);