Skip to content

Commit

Permalink
fix(managed-delivery): Fix adoption report endpoint (#1433)
Browse files Browse the repository at this point in the history
  • Loading branch information
luispollo committed Mar 3, 2021
1 parent e6e09a8 commit 8b300c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ Response getOnboardingReport(

@GET("/reports/adoption")
@Headers("Accept: text/html")
String getAdoptionReport(@QueryMap Map<String, String> params);
Response getAdoptionReport(@QueryMap Map<String, String> params);

@GET("/environments/{application}")
List<Map<String, Object>> getEnvironments(@Path("application") String application);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import retrofit.RetrofitError;
import retrofit.client.Header;
Expand Down Expand Up @@ -405,9 +404,12 @@ ResponseEntity<byte[]> getOnboardingReport(

@ApiOperation(value = "Get a report of Managed Delivery adoption")
@GetMapping(path = "/reports/adoption", produces = "text/html")
@ResponseBody
String getAdoptionReport(@RequestParam Map<String, String> params) {
return keelService.getAdoptionReport(params);
ResponseEntity<byte[]> getAdoptionReport(@RequestParam Map<String, String> params)
throws IOException {
Response keelResponse = keelService.getAdoptionReport(params);
return ResponseEntity.status(keelResponse.getStatus())
.header("Content-Type", "text/html")
.body(keelResponse.getBody().in().readAllBytes());
}

@ApiOperation(value = "Get current environment details")
Expand Down

0 comments on commit 8b300c6

Please sign in to comment.