Skip to content
Snippets Groups Projects

Dev to master

6 files
+ 144
9
Compare changes
  • Side-by-side
  • Inline

Files

@@ -23,6 +23,7 @@ import javax.transaction.Transactional;
import nl.tudelft.labracore.dto.create.StudentGroupCreateDTO;
import nl.tudelft.labracore.dto.helper.GroupGenerateDTO;
import nl.tudelft.labracore.dto.helper.GroupImportDTO;
import nl.tudelft.labracore.dto.patch.StudentGroupPatchDTO;
import nl.tudelft.labracore.dto.view.structured.details.StudentGroupDetailsDTO;
import nl.tudelft.labracore.dto.view.structured.summary.RoleSummaryDTO;
@@ -203,6 +204,21 @@ public class StudentGroupController {
sgs.allocateGroupsForModule(moduleId, capacity);
}
/**
* Imports groups to a module.
*
* @param moduleId The id of the module
* @param groups The groups to import
* @param createUsers Whether to create non-existent users
*/
@PostMapping("/{moduleId}/import")
@PreAuthorize("hasAuthority('STUDENT_GROUP_CREATE')")
public List<String> importGroupsToModule(@PathVariable Long moduleId,
@RequestBody GroupImportDTO groups,
@RequestParam(required = false, defaultValue = "false") Boolean createUsers) {
return sgs.importGroups(moduleId, groups.getGroups(), createUsers);
}
/**
* Removes a member from a group.
*
Loading