diff --git a/src/main/java/cz/cvut/kbss/study/rest/PatientRecordController.java b/src/main/java/cz/cvut/kbss/study/rest/PatientRecordController.java index 03bae9c5..493c3f7a 100644 --- a/src/main/java/cz/cvut/kbss/study/rest/PatientRecordController.java +++ b/src/main/java/cz/cvut/kbss/study/rest/PatientRecordController.java @@ -76,14 +76,13 @@ public ResponseEntity exportRecords( return switch (exportType.toString()){ case Constants.MEDIA_TYPE_EXCEL -> exportRecordsExcel(params, response); - case MediaType.APPLICATION_JSON_VALUE -> exportRecordsAsJson(institutionKey, params, uriBuilder, response); + case MediaType.APPLICATION_JSON_VALUE -> exportRecordsAsJson(params, uriBuilder, response); default -> throw new IllegalArgumentException("Unsupported export type: " + exportType); }; } protected ResponseEntity> exportRecordsAsJson( - @RequestParam(name = "institution", required = false) String institutionKey, - @RequestParam MultiValueMap params, + MultiValueMap params, UriComponentsBuilder uriBuilder, HttpServletResponse response){ final Page result = recordService.findAllFull(RecordFilterMapper.constructRecordFilter(params), RestUtils.resolvePaging(params)); @@ -93,7 +92,7 @@ protected ResponseEntity> exportRecordsAsJson( .body(result.getContent()); } - public ResponseEntity exportRecordsExcel(@RequestParam(required = false) MultiValueMap params, HttpServletResponse response){ + public ResponseEntity exportRecordsExcel(MultiValueMap params, HttpServletResponse response){ RecordFilterParams filterParams = new RecordFilterParams(); filterParams.setMinModifiedDate(null); filterParams.setMaxModifiedDate(null); @@ -105,7 +104,6 @@ public ResponseEntity exportRecordsExcel(@RequestParam(requ .contentType(MediaType.parseMediaType(Constants.MEDIA_TYPE_EXCEL)) .header(HttpHeaders.CONTENT_DISPOSITION, contentDisposition.toString()) .body(new InputStreamResource(stream)); - } @PreAuthorize("hasRole('" + SecurityConstants.ROLE_ADMIN + "') or @securityUtils.isRecordInUsersInstitution(#key)")