diff --git a/backend/pkg/api/handlers/public.go b/backend/pkg/api/handlers/public.go index 7080b80a1..a9c43f9d2 100644 --- a/backend/pkg/api/handlers/public.go +++ b/backend/pkg/api/handlers/public.go @@ -539,7 +539,7 @@ func (h *HandlerService) PublicDeleteValidatorDashboardGroupValidators(w http.Re func (h *HandlerService) PublicPostValidatorDashboardValidators(w http.ResponseWriter, r *http.Request) { var v validationError dashboardId := v.checkPrimaryDashboardId(mux.Vars(r)["dashboard_id"]) - type request struct { + type request struct { // this must align with PostValidatorDashboardValidatorsRequest GroupId uint64 `json:"group_id,omitempty" x-nullable:"true"` Validators []intOrString `json:"validators,omitempty"` DepositAddress string `json:"deposit_address,omitempty"` diff --git a/backend/pkg/api/types/validator_dashboard.go b/backend/pkg/api/types/validator_dashboard.go index 043fa0dce..6e0122ab2 100644 --- a/backend/pkg/api/types/validator_dashboard.go +++ b/backend/pkg/api/types/validator_dashboard.go @@ -365,3 +365,12 @@ type VDBPostValidatorsData struct { Index uint64 `json:"index"` GroupId uint64 `json:"group_id"` } + +// helper for frontend +type PostValidatorDashboardValidatorsRequest struct { + GroupId uint64 `json:"group_id,omitempty" x-nullable:"true"` + Validators []interface{} `json:"validators,omitempty" tstype:"(number | string)[]"` + DepositAddress string `json:"deposit_address,omitempty"` + WithdrawalCredential string `json:"withdrawal_credential,omitempty"` + Graffiti string `json:"graffiti,omitempty"` +} diff --git a/frontend/types/api/validator_dashboard.ts b/frontend/types/api/validator_dashboard.ts index 5128ee519..41ffdee03 100644 --- a/frontend/types/api/validator_dashboard.ts +++ b/frontend/types/api/validator_dashboard.ts @@ -321,3 +321,13 @@ export interface VDBPostValidatorsData { index: number /* uint64 */; group_id: number /* uint64 */; } +/** + * helper for frontend + */ +export interface PostValidatorDashboardValidatorsRequest { + group_id?: number /* uint64 */; + validators?: (number | string)[]; + deposit_address?: string; + withdrawal_credential?: string; + graffiti?: string; +}