Skip to content

Commit 196fbba

Browse files
committed
fix(vulnerability): default sort with lastUpdated
Signed-off-by: Gaurav Mishra <[email protected]>
1 parent 22d5dfc commit 196fbba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

rest/resource-server/src/main/java/org/eclipse/sw360/rest/resourceserver/vulnerability/Sw360VulnerabilityService.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,18 +339,19 @@ public List<ReleaseClearingStatusData> getReleasesClearingStatusWithAccessibilit
339339
* @return a PaginationData object representing the pagination information
340340
*/
341341
private static PaginationData pageableToPaginationData(@NotNull Pageable pageable) {
342-
VulnerabilitySortColumn column = VulnerabilitySortColumn.BY_EXTERNALID;
342+
VulnerabilitySortColumn column = VulnerabilitySortColumn.BY_LASTUPDATED;
343343
boolean ascending = false;
344344

345345
if (pageable.getSort().isSorted()) {
346346
Sort.Order order = pageable.getSort().iterator().next();
347347
String property = order.getProperty();
348348
column = switch (property) {
349+
case "externalId" -> VulnerabilitySortColumn.BY_EXTERNALID;
349350
case "title" -> VulnerabilitySortColumn.BY_TITLE;
350351
case "cvss" -> VulnerabilitySortColumn.BY_WEIGHTING;
351352
case "publishDate" -> VulnerabilitySortColumn.BY_PUBLISHDATE;
352353
case "lastUpdateDate" -> VulnerabilitySortColumn.BY_LASTUPDATED;
353-
default -> column; // Default to BY_EXTERNALID if no match
354+
default -> column; // Default to BY_LASTUPDATED if no match
354355
};
355356
ascending = order.isAscending();
356357
}

0 commit comments

Comments
 (0)