Skip to content
Snippets Groups Projects

Resolve "Group endpoint: getGroupsForPersonAndModule"

3 files
+ 13
10
Compare changes
  • Side-by-side
  • Inline

Files

@@ -26,6 +26,7 @@ import nl.tudelft.labracore.dto.helper.GroupGenerateDTO;
import nl.tudelft.labracore.dto.patch.StudentGroupPatchDTO;
import nl.tudelft.labracore.dto.view.other.StudentGroupShortDetailsDTO;
import nl.tudelft.labracore.dto.view.other.StudentGroupSummaryDTO;
import nl.tudelft.labracore.dto.view.structured.details.StudentGroupDetailsDTO;
import nl.tudelft.labracore.dto.view.structured.summary.RoleSummaryDTO;
import nl.tudelft.labracore.repository.StudentGroupRepository;
import nl.tudelft.labracore.service.RoleService;
@@ -278,10 +279,10 @@ public class StudentGroupController {
*/
@GetMapping("/by-person-and-module/{personId}/{moduleId}")
@PreAuthorize("hasAuthority('STUDENT_GROUP_READ')")
public List<StudentGroupSummaryDTO> getGroupsForPersonAndModule(@PathVariable Long personId,
public StudentGroupDetailsDTO getGroupForPersonAndModule(@PathVariable Long personId,
@PathVariable Long moduleId) {
return View.convert(sgr.findAllByModuleAndPersonIn(personId, moduleId),
StudentGroupSummaryDTO.class);
return View.convert(sgr.findByModuleAndPersonIn(personId, moduleId),
StudentGroupDetailsDTO.class);
}
}
Loading