Skip to content

Commit

Permalink
fix workload report file download
Browse files Browse the repository at this point in the history
  • Loading branch information
jaroldwong committed Mar 11, 2024
1 parent 8669004 commit 1ebe375
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,16 @@ public ResponseEntity generateMultipleDepartments(@PathVariable long workgroupId
return new ResponseEntity<>(HttpStatus.ACCEPTED);
}

@RequestMapping(value = "/api/workloadSummaryReport/{workgroupId}/years/{year}/downloadMultiple/{file}", method = RequestMethod.POST)
public ResponseEntity downloadMultipleDepartments(@PathVariable long workgroupId, @PathVariable long year, @PathVariable String file) {
@RequestMapping(value = "/api/workloadSummaryReport/years/{year}/downloadMultiple/{filename}", method = RequestMethod.POST)
public ResponseEntity downloadMultipleDepartments(@PathVariable long year, @PathVariable String filename) {
authorizer.isDeansOffice();

String filename = null;
if (file.equals("workloadSummaries")) {
if (filename.equals("workloadSummaries")) {
filename = year + "_Workload_Summary_Report.xlsx";
} else if (file.equals("workloadSnapshots")) {
} else if (filename.equals("workloadSnapshots")) {
filename = year + "_Workload_Snapshots.xlsx";
} else {
return ResponseEntity.status(HttpStatus.NOT_FOUND).body("File not found.");
}

byte[] bytes = s3Service.download(filename);
Expand Down

0 comments on commit 1ebe375

Please sign in to comment.