From c7d33c11762345ad854ff153af12a02b9b8219b3 Mon Sep 17 00:00:00 2001 From: Annie Lee Date: Tue, 15 Mar 2022 14:55:00 -0700 Subject: [PATCH] Revert "Update TransportGetFindingsSearchAction.kt" This reverts commit 2c21988ca716d55f5a05584bdd51ed4ae2ea6cff. --- .../alerting/transport/TransportGetFindingsSearchAction.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetFindingsSearchAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetFindingsSearchAction.kt index ab4ac7881..31a49a63d 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetFindingsSearchAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetFindingsSearchAction.kt @@ -140,7 +140,7 @@ class TransportGetFindingsSearchAction @Inject constructor( searchRequest, object : ActionListener { override fun onResponse(response: SearchResponse) { - /* val totalFindingCount = response.hits.totalHits?.value?.toInt() + val totalFindingCount = response.hits.totalHits?.value?.toInt() val findings = mutableListOf() for (hit in response.hits) { // Debug use @@ -153,9 +153,7 @@ class TransportGetFindingsSearchAction @Inject constructor( XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_OBJECT, xcp.nextToken(), xcp) findings.add(Finding.parse(xcp, id)) } - */ - // actionListener.onResponse(GetFindingsSearchResponse(RestStatus.OK, totalFindingCount, findings)) - actionListener.onResponse(response) + actionListener.onResponse(GetFindingsSearchResponse(RestStatus.OK, totalFindingCount, findings)) } override fun onFailure(t: Exception) {