diff --git a/backend/pkg/api/handlers/internal.go b/backend/pkg/api/handlers/internal.go index 8ea6de686..78d998856 100644 --- a/backend/pkg/api/handlers/internal.go +++ b/backend/pkg/api/handlers/internal.go @@ -493,7 +493,7 @@ func (h *HandlerService) InternalGetValidatorDashboardMobileWidget(w http.Respon handleErr(w, r, err) return } - if !userInfo.PremiumPerks.MobileAppWidget { + if userInfo.UserGroup != types.UserGroupAdmin && !userInfo.PremiumPerks.MobileAppWidget { returnForbidden(w, r, errors.New("user does not have access to mobile app widget")) return } diff --git a/backend/pkg/api/handlers/public.go b/backend/pkg/api/handlers/public.go index 462587390..e0e560b8c 100644 --- a/backend/pkg/api/handlers/public.go +++ b/backend/pkg/api/handlers/public.go @@ -867,7 +867,7 @@ func (h *HandlerService) PublicDeleteValidatorDashboardPublicId(w http.ResponseW // @Param request body handlers.PublicPutValidatorDashboardArchiving.request true "request" // @Success 200 {object} types.ApiDataResponse[types.VDBPostArchivingReturnData] // @Failure 400 {object} types.ApiErrorResponse -// @Conflict 409 {object} types.ApiErrorResponse "Conflict. The request could not be performed by the server because the authenticated user has already reached their subscription limit." +// @Failure 409 {object} types.ApiErrorResponse "Conflict. The request could not be performed by the server because the authenticated user has already reached their subscription limit." // @Router /validator-dashboards/{dashboard_id}/archiving [put] func (h *HandlerService) PublicPutValidatorDashboardArchiving(w http.ResponseWriter, r *http.Request) { var v validationError diff --git a/backend/pkg/api/router.go b/backend/pkg/api/router.go index 1a5282188..16ab4c0b2 100644 --- a/backend/pkg/api/router.go +++ b/backend/pkg/api/router.go @@ -304,7 +304,7 @@ func addValidatorDashboardRoutes(hs *handlers.HandlerService, publicRouter, inte {http.MethodGet, "/{dashboard_id}/total-rocket-pool", hs.PublicGetValidatorDashboardTotalRocketPool, hs.InternalGetValidatorDashboardTotalRocketPool}, {http.MethodGet, "/{dashboard_id}/rocket-pool/{node_address}", hs.PublicGetValidatorDashboardNodeRocketPool, hs.InternalGetValidatorDashboardNodeRocketPool}, {http.MethodGet, "/{dashboard_id}/rocket-pool/{node_address}/minipools", hs.PublicGetValidatorDashboardRocketPoolMinipools, hs.InternalGetValidatorDashboardRocketPoolMinipools}, - {http.MethodGet, "/{dashboard_id}/mobile-widget", nil, hs.InternalGetValidatorDashboardRocketPoolMinipools}, + {http.MethodGet, "/{dashboard_id}/mobile-widget", nil, hs.InternalGetValidatorDashboardMobileWidget}, } addEndpointsToRouters(endpoints, publicDashboardRouter, internalDashboardRouter) } diff --git a/backend/pkg/api/types/mobile.go b/backend/pkg/api/types/mobile.go index a89cd7ea1..62c323b0d 100644 --- a/backend/pkg/api/types/mobile.go +++ b/backend/pkg/api/types/mobile.go @@ -10,14 +10,14 @@ type MobileBundleData struct { type GetMobileLatestBundleResponse ApiDataResponse[MobileBundleData] type MobileWidgetData struct { - StateCounts ValidatorStateCounts `json:"state_counts"` - Last24hIncome decimal.Decimal `json:"last_24h_income"` - Last7dIncome decimal.Decimal `json:"last_7d_income"` - Last30dApr float64 `json:"last_30d_apr"` - Last30dEfficiency decimal.Decimal `json:"last_30d_efficiency"` - NetworkEfficiency float64 `json:"network_efficiency"` - RplPrice decimal.Decimal `json:"rpl_price"` - RplApr float64 `json:"rpl_apr"` + ValidatorStateCounts ValidatorStateCounts `json:"validator_state_counts"` + Last24hIncome decimal.Decimal `json:"last_24h_income" faker:"eth"` + Last7dIncome decimal.Decimal `json:"last_7d_income" faker:"eth"` + Last30dApr float64 `json:"last_30d_apr"` + Last30dEfficiency decimal.Decimal `json:"last_30d_efficiency" faker:"eth"` + NetworkEfficiency float64 `json:"network_efficiency"` + RplPrice decimal.Decimal `json:"rpl_price" faker:"eth"` + RplApr float64 `json:"rpl_apr"` } type InternalGetValidatorDashboardMobileWidgetResponse ApiDataResponse[MobileWidgetData] diff --git a/frontend/types/api/mobile.ts b/frontend/types/api/mobile.ts index 0b42df7ca..335bd2aef 100644 --- a/frontend/types/api/mobile.ts +++ b/frontend/types/api/mobile.ts @@ -11,7 +11,7 @@ export interface MobileBundleData { } export type GetMobileLatestBundleResponse = ApiDataResponse; export interface MobileWidgetData { - state_counts: ValidatorStateCounts; + validator_state_counts: ValidatorStateCounts; last_24h_income: string /* decimal.Decimal */; last_7d_income: string /* decimal.Decimal */; last_30d_apr: number /* float64 */;