diff --git a/server/semantics-service/src/main/java/edu/illinois/ncsa/incore/service/semantics/controllers/TypeController.java b/server/semantics-service/src/main/java/edu/illinois/ncsa/incore/service/semantics/controllers/TypeController.java index 7f2bdec0..0564cd89 100644 --- a/server/semantics-service/src/main/java/edu/illinois/ncsa/incore/service/semantics/controllers/TypeController.java +++ b/server/semantics-service/src/main/java/edu/illinois/ncsa/incore/service/semantics/controllers/TypeController.java @@ -104,6 +104,7 @@ public TypeController( @Operation(summary = "list all types belong user has access to.") public Response listTypes( @Parameter(name = "Name of the space.") @DefaultValue("") @QueryParam("space") String spaceName, + @Parameter(name = "Specify the field or attribute on which the sorting is to be performed.") @DefaultValue("name") @QueryParam("sortBy") String sortBy, @Parameter(name = "Specify the order of sorting, either ascending or descending.") @DefaultValue("asc") @QueryParam("order") String order, @Parameter(name = "Skip the first n results.") @DefaultValue("0") @QueryParam("skip") int offset, @Parameter(name = "Limit number of results to return.") @DefaultValue("50") @QueryParam("limit") int limit, @@ -111,7 +112,7 @@ public Response listTypes( @Parameter(name = "Return the full response.") @DefaultValue("false") @QueryParam("detail") boolean detail) { // import type comparator - Comparator comparator = typeComparator("name", order); + Comparator comparator = typeComparator(sortBy, order); List typeList = this.typeDAO.getTypes();