Update SlipGajiController.java

Penyesuaian content disposition filename path generate file excel
This commit is contained in:
Salman Manoe 2023-04-26 08:09:44 +07:00
parent a4e4fdaca8
commit 13065f98a3

View File

@ -92,7 +92,9 @@ public class SlipGajiController {
String fileNamePath = slipGajiService.writeExcel(bulan);
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment; filename=" + fileNamePath);
return new ResponseEntity<>(true, HttpStatus.OK);
Map<String, Object> result = new HashMap<>();
result.put("filename", fileNamePath);
return new ResponseEntity<>(result, HttpStatus.OK);
} catch (Exception e) {
e.printStackTrace();
return new ResponseEntity<>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);