From cdf15c9d49e5f67be3b77234403345bbba8e76df Mon Sep 17 00:00:00 2001 From: "n.nakhostin" Date: Tue, 23 Sep 2025 13:35:00 +0330 Subject: [PATCH] Update Notification API Endpoint Paths for Consistency - Modified the route for marking notifications as seen to ensure a consistent and clear API structure. - Updated the notification client to reflect the new endpoint path for marking all notifications as seen, enhancing clarity for API consumers. - These changes improve the overall usability and maintainability of the notification API. --- cmd/web/router/routes.go | 4 ++-- pkg/notification/client.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/web/router/routes.go b/cmd/web/router/routes.go index 2d276cf..890e09b 100644 --- a/cmd/web/router/routes.go +++ b/cmd/web/router/routes.go @@ -218,7 +218,7 @@ func RegisterPublicRoutes(e *echo.Echo, customerHandler *customer.Handler, tende notificationsGP.Use(customerHandler.AuthMiddleware()) notificationsGP.GET("", notificationHandler.CustomerNotifications) notificationsGP.GET("/view/:id", notificationHandler.PublicViewNotification) - notificationsGP.GET("mark", notificationHandler.PublicAllMarkSeen) - notificationsGP.GET("mark/:id", notificationHandler.PublicMarkSeen) + notificationsGP.GET("/mark", notificationHandler.PublicAllMarkSeen) + notificationsGP.GET("/mark/:id", notificationHandler.PublicMarkSeen) } } diff --git a/pkg/notification/client.go b/pkg/notification/client.go index 6e0cfe8..8cc998b 100644 --- a/pkg/notification/client.go +++ b/pkg/notification/client.go @@ -443,7 +443,7 @@ func (c *Client) AllMarkSeen(ctx context.Context, userID string) (*MarkSeenRespo } // Create HTTP request - url := fmt.Sprintf("%s/api/v1/notifications/all-seen/%s", c.config.BaseURL, userID) + url := fmt.Sprintf("%s/api/v1/notifications/seen-all/%s", c.config.BaseURL, userID) httpReq, err := http.NewRequestWithContext(ctx, "PUT", url, nil) if err != nil { return nil, fmt.Errorf("failed to create HTTP request: %w", err)