From 125baca2dbb1e983c96d7176d2b20c7b522c96e5 Mon Sep 17 00:00:00 2001 From: caelum0x Date: Sun, 18 Oct 2026 00:36:20 +0300 Subject: [PATCH] fix(backend): wire mobile settings screen to notification preferences API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- gitgram/backend/src/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gitgram/backend/src/index.ts b/gitgram/backend/src/index.ts index ba430b18..5066dda0 100644 --- a/gitgram/backend/src/index.ts +++ b/gitgram/backend/src/index.ts @@ -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);