Skip to content

Commit 635a10d

Browse files
committed
feat: add PostValidatorDashboardValidatorsRequest for frontend
1 parent 583446b commit 635a10d

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

backend/pkg/api/handlers/public.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ func (h *HandlerService) PublicDeleteValidatorDashboardGroupValidators(w http.Re
539539
func (h *HandlerService) PublicPostValidatorDashboardValidators(w http.ResponseWriter, r *http.Request) {
540540
var v validationError
541541
dashboardId := v.checkPrimaryDashboardId(mux.Vars(r)["dashboard_id"])
542-
type request struct {
542+
type request struct { // this must align with PostValidatorDashboardValidatorsRequest
543543
GroupId uint64 `json:"group_id,omitempty" x-nullable:"true"`
544544
Validators []intOrString `json:"validators,omitempty"`
545545
DepositAddress string `json:"deposit_address,omitempty"`

backend/pkg/api/types/validator_dashboard.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,3 +365,12 @@ type VDBPostValidatorsData struct {
365365
Index uint64 `json:"index"`
366366
GroupId uint64 `json:"group_id"`
367367
}
368+
369+
// helper for frontend
370+
type PostValidatorDashboardValidatorsRequest struct {
371+
GroupId uint64 `json:"group_id,omitempty" x-nullable:"true"`
372+
Validators []interface{} `json:"validators,omitempty" tstype:"(number | string)[]"`
373+
DepositAddress string `json:"deposit_address,omitempty"`
374+
WithdrawalCredential string `json:"withdrawal_credential,omitempty"`
375+
Graffiti string `json:"graffiti,omitempty"`
376+
}

frontend/types/api/validator_dashboard.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,3 +321,13 @@ export interface VDBPostValidatorsData {
321321
index: number /* uint64 */;
322322
group_id: number /* uint64 */;
323323
}
324+
/**
325+
* helper for frontend
326+
*/
327+
export interface PostValidatorDashboardValidatorsRequest {
328+
group_id?: number /* uint64 */;
329+
validators?: (number | string)[];
330+
deposit_address?: string;
331+
withdrawal_credential?: string;
332+
graffiti?: string;
333+
}

0 commit comments

Comments
 (0)