From 46b2aef97908ec8147b6fa7f3c93d4d3a54c2278 Mon Sep 17 00:00:00 2001 From: Andrei Date: Thu, 9 Oct 2025 13:44:50 +0000 Subject: [PATCH] fix: Add missing /api/v1 prefix to notification endpoints MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All notification API calls were missing the /api/v1 prefix causing 404 errors. Fixed all endpoints: - GET /api/v1/notifications - PATCH /api/v1/notifications/:id/read - PATCH /api/v1/notifications/mark-all-read - PATCH /api/v1/notifications/:id/dismiss 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- maternal-web/lib/api/notifications.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/maternal-web/lib/api/notifications.ts b/maternal-web/lib/api/notifications.ts index 13c41dc..2aa5298 100644 --- a/maternal-web/lib/api/notifications.ts +++ b/maternal-web/lib/api/notifications.ts @@ -44,7 +44,7 @@ export const notificationsApi = { * Get user notifications with optional filters */ async getNotifications(params?: GetNotificationsParams): Promise { - const { data } = await apiClient.get>('/notifications', { params }); + const { data } = await apiClient.get>('/api/v1/notifications', { params }); const notifications = data.data.notifications; const unreadCount = notifications.filter(n => !n.readAt && !n.dismissedAt).length; @@ -60,7 +60,7 @@ export const notificationsApi = { * Mark a notification as read */ async markAsRead(notificationId: string): Promise { - const { data } = await apiClient.patch>(`/notifications/${notificationId}/read`); + const { data } = await apiClient.patch>(`/api/v1/notifications/${notificationId}/read`); // Backend returns success message, not the notification, so we return empty object return {} as Notification; }, @@ -69,7 +69,7 @@ export const notificationsApi = { * Mark all notifications as read */ async markAllAsRead(): Promise<{ count: number }> { - await apiClient.patch>('/notifications/mark-all-read'); + await apiClient.patch>('/api/v1/notifications/mark-all-read'); return { count: 0 }; // Backend doesn't return count }, @@ -77,7 +77,7 @@ export const notificationsApi = { * Dismiss a notification */ async dismiss(notificationId: string): Promise { - await apiClient.patch>(`/notifications/${notificationId}/dismiss`); + await apiClient.patch>(`/api/v1/notifications/${notificationId}/dismiss`); return {} as Notification; },