@@ -354,18 +354,29 @@ func addNotificationRoutes(hs *handlers.HandlerService, publicRouter, internalRo
354354
355355 publicDashboardNotificationSettingsRouter := publicNotificationRouter .NewRoute ().Subrouter ()
356356 internalDashboardNotificationSettingsRouter := internalNotificationRouter .NewRoute ().Subrouter ()
357- // TODO add adb auth and archivedCheck middleware to account dashboard endpoints once they are implemented
357+ // TODO add adb auth middleware to account dashboard endpoints once they are implemented
358358 if ! debug {
359359 publicDashboardNotificationSettingsRouter .Use (hs .VDBAuthMiddleware , hs .VDBArchivedCheckMiddleware )
360360 internalDashboardNotificationSettingsRouter .Use (hs .VDBAuthMiddleware , hs .VDBArchivedCheckMiddleware )
361361 }
362362 dashboardSettingsEndpoints := []endpoint {
363363 {http .MethodGet , "/validator-dashboards/{dashboard_id}/groups/{group_id}/epochs/{epoch}" , hs .PublicGetUserNotificationsValidatorDashboard , hs .InternalGetUserNotificationsValidatorDashboard },
364364 {http .MethodGet , "/account-dashboards/{dashboard_id}/groups/{group_id}/epochs/{epoch}" , hs .PublicGetUserNotificationsAccountDashboard , hs .InternalGetUserNotificationsAccountDashboard },
365+ }
366+ addEndpointsToRouters (dashboardSettingsEndpoints , publicDashboardNotificationSettingsRouter , internalDashboardNotificationSettingsRouter )
367+
368+ publicActiveDashboardNotificationSettingsRouter := publicDashboardNotificationSettingsRouter .NewRoute ().Subrouter ()
369+ internalActiveDashboardNotificationSettingsRouter := internalDashboardNotificationSettingsRouter .NewRoute ().Subrouter ()
370+ // TODO add archivedCheck middleware to account dashboard endpoints once they are implemented
371+ if ! debug {
372+ publicActiveDashboardNotificationSettingsRouter .Use (hs .VDBArchivedCheckMiddleware )
373+ internalActiveDashboardNotificationSettingsRouter .Use (hs .VDBArchivedCheckMiddleware )
374+ }
375+ activeDashboardSettingsEndpoints := []endpoint {
365376 {http .MethodPut , "/settings/validator-dashboards/{dashboard_id}/groups/{group_id}" , hs .PublicPutUserNotificationSettingsValidatorDashboard , hs .InternalPutUserNotificationSettingsValidatorDashboard },
366377 {http .MethodPut , "/settings/account-dashboards/{dashboard_id}/groups/{group_id}" , hs .PublicPutUserNotificationSettingsAccountDashboard , hs .InternalPutUserNotificationSettingsAccountDashboard },
367378 }
368- addEndpointsToRouters (dashboardSettingsEndpoints , publicDashboardNotificationSettingsRouter , internalDashboardNotificationSettingsRouter )
379+ addEndpointsToRouters (activeDashboardSettingsEndpoints , publicActiveDashboardNotificationSettingsRouter , internalActiveDashboardNotificationSettingsRouter )
369380}
370381
371382func addEndpointsToRouters (endpoints []endpoint , publicRouter * mux.Router , internalRouter * mux.Router ) {
0 commit comments