Skip to content

Commit

Permalink
fix: group name search for hidden groups
Browse files Browse the repository at this point in the history
  • Loading branch information
sasha-bitfly committed Nov 27, 2024
1 parent 8d49182 commit e95f9c9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/pkg/api/data_access/vdb_blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ func (d *DataAccessService) GetValidatorDashboardBlocks(ctx context.Context, das
}

searchPubkey := regexp.MustCompile(`^0x[0-9a-fA-F]{96}$`).MatchString(search)
searchGroup := regexp.MustCompile(`^[a-zA-Z0-9_\-.\ ]+$`).MatchString(search)
searchGroup := !dashboardId.AggregateGroups && regexp.MustCompile(`^[a-zA-Z0-9_\-.\ ]+$`).MatchString(search)
searchIndex := regexp.MustCompile(`^[0-9]+$`).MatchString(search)

if search != "" && !searchPubkey && !searchGroup && !searchIndex {
return make([]t.VDBBlocksTableRow, 0), &t.Paging{}, nil
}

validators := goqu.T("validators") // could adapt data type to make handling as table/alias less confusing
blocks := goqu.T("blocks")
groups := goqu.T("groups")
Expand Down

0 comments on commit e95f9c9

Please sign in to comment.