Skip to content

wip return metadata for studycreationrequests #596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public ResponseEntity<List<BasicStudyInfos>> getStudyCreationRequestList() {
@GetMapping(value = "/studies/metadata")
@Operation(summary = "Get studies metadata")
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "The list of studies metadata")})
public ResponseEntity<List<CreatedStudyBasicInfos>> getStudyListMetadata(@RequestParam("ids") List<UUID> uuids) {
public ResponseEntity<List<BasicStudyInfos>> getStudyListMetadata(@RequestParam("ids") List<UUID> uuids) {
return ResponseEntity.ok().contentType(MediaType.APPLICATION_JSON).body(studyService.getStudiesMetadata(uuids));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,10 @@ public String getStudyCaseName(UUID studyUuid) {
return study != null ? study.getCaseName() : "";
}

public List<CreatedStudyBasicInfos> getStudiesMetadata(List<UUID> uuids) {
return studyRepository.findAllById(uuids).stream().map(StudyService::toCreatedStudyBasicInfos)
public List<BasicStudyInfos> getStudiesMetadata(List<UUID> uuids) {
return Stream.concat(
studyRepository.findAllById(uuids).stream().map(StudyService::toCreatedStudyBasicInfos),
studyCreationRequestRepository.findAllById(uuids).stream().map(StudyService::toBasicStudyInfos))
.collect(Collectors.toList());

}
Expand Down
Loading