Skip to content

Commit

Permalink
Use enum string instead of value in KwClustersModelResponse's getClus…
Browse files Browse the repository at this point in the history
…tersPaginated

Signed-off-by: Mirjam Aulbach <[email protected]>
  • Loading branch information
programmiri committed Feb 27, 2024
1 parent b95e496 commit 9fcd961
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion coral/src/domain/cluster/cluster-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async function getClustersPaginated({
"clusterType"
>): Promise<ClustersPaginatedApiResponse> {
const params: KlawApiRequestQueryParameters<"getClustersPaginated"> = {
clusterType: "all",
clusterType: "ALL",
pageNo,
...(searchClusterParam && { searchClusterParam: searchClusterParam }),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public ResponseEntity<List<KwClustersModelResponse>> getClusters(
method = RequestMethod.GET,
produces = {MediaType.APPLICATION_JSON_VALUE})
public ResponseEntity<List<KwClustersModelResponse>> getClustersPaginated(
@RequestParam(value = "clusterType") String clusterType,
@RequestParam(value = "clusterType") KafkaClustersType clusterType,
@RequestParam("pageNo") String pageNo,
@RequestParam(value = "clusterId", defaultValue = "") String clusterId,
@RequestParam(value = "searchClusterParam", defaultValue = "") String searchClusterParam) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,10 @@ public List<KwClustersModelResponse> getClusters(String typeOfCluster) {
}

public List<KwClustersModelResponse> getClustersPaginated(
String typeOfCluster, String clusterId, String pageNo, String searchClusterParam) {
List<KwClustersModelResponse> kwClustersModelList = getClusters("all");
KafkaClustersType typeOfCluster, String clusterId, String pageNo, String searchClusterParam) {

String clusterTypeValue = typeOfCluster.value;
List<KwClustersModelResponse> kwClustersModelList = getClusters(clusterTypeValue);

if (clusterId != null && !clusterId.equals("")) {
kwClustersModelList =
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/resources/static/js/envs.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,9 @@ app.controller("envsCtrl", function($scope, $http, $location, $window) {
method: "GET",
url: "getClustersPaginated",
headers : { 'Content-Type' : 'application/json' },
params: {'clusterType' : 'all', 'clusterId' : $scope.clusterIdFromUrl,
params: {'clusterType' : 'ALL', 'clusterId' : $scope.clusterIdFromUrl,
'pageNo' : pageNo, 'searchClusterParam' : $scope.searchClusterParam},
data: {'clusterType' : 'all'}
data: {'clusterType' : 'ALL'}
}).success(function(output) {
$scope.allclustersset = output;
if(output && output.length > 0 && output[0] != null){
Expand Down

0 comments on commit 9fcd961

Please sign in to comment.