Skip to content

Commit

Permalink
Allow viewing the entire registry with no search param
Browse files Browse the repository at this point in the history
  • Loading branch information
me4502 committed Oct 14, 2024
1 parent b6e22f5 commit f65c6f7
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ public void registry(Actor actor,
Registry<?> registry,
@ArgFlag(name = 'p', desc = "Page of results to return", def = "1")
int page,
@Arg(desc = "Search query", variable = true)
@Arg(desc = "Search query", variable = true, def = "")
List<String> query) {
String search = String.join(" ", query);

Expand Down Expand Up @@ -576,7 +576,8 @@ public Component call() throws Exception {
}
}
List<Component> list = new ArrayList<>(results.values());
return PaginationBox.fromComponents("Search results for '" + search + "'", command, list)
String title = search.isBlank() ? "Registry contents" : "Search results for '" + search + "'";
return PaginationBox.fromComponents(title, command, list)
.create(page);
}
}
Expand Down

0 comments on commit f65c6f7

Please sign in to comment.