diff --git a/src/main/java/de/tum/cit/aet/artemis/lecture/service/AttachmentUnitService.java b/src/main/java/de/tum/cit/aet/artemis/lecture/service/AttachmentUnitService.java index e86d7c22e7f5..83d3ffdf6751 100644 --- a/src/main/java/de/tum/cit/aet/artemis/lecture/service/AttachmentUnitService.java +++ b/src/main/java/de/tum/cit/aet/artemis/lecture/service/AttachmentUnitService.java @@ -117,6 +117,7 @@ public AttachmentUnit updateAttachmentUnit(AttachmentUnit existingAttachmentUnit existingAttachmentUnit.setDescription(updateUnit.getDescription()); existingAttachmentUnit.setName(updateUnit.getName()); existingAttachmentUnit.setReleaseDate(updateUnit.getReleaseDate()); + existingAttachmentUnit.setCompetencyLinks(updateUnit.getCompetencyLinks()); AttachmentUnit savedAttachmentUnit = lectureUnitService.saveWithCompetencyLinks(existingAttachmentUnit, attachmentUnitRepository::saveAndFlush); diff --git a/src/main/java/de/tum/cit/aet/artemis/lecture/web/AttachmentUnitResource.java b/src/main/java/de/tum/cit/aet/artemis/lecture/web/AttachmentUnitResource.java index 0c7c2996e162..166f3638051a 100644 --- a/src/main/java/de/tum/cit/aet/artemis/lecture/web/AttachmentUnitResource.java +++ b/src/main/java/de/tum/cit/aet/artemis/lecture/web/AttachmentUnitResource.java @@ -100,7 +100,7 @@ public AttachmentUnitResource(AttachmentUnitRepository attachmentUnitRepository, @EnforceAtLeastEditor public ResponseEntity getAttachmentUnit(@PathVariable Long attachmentUnitId, @PathVariable Long lectureId) { log.debug("REST request to get AttachmentUnit : {}", attachmentUnitId); - AttachmentUnit attachmentUnit = attachmentUnitRepository.findByIdElseThrow(attachmentUnitId); + AttachmentUnit attachmentUnit = attachmentUnitRepository.findOneWithSlidesAndCompetencies(attachmentUnitId); checkAttachmentUnitCourseAndLecture(attachmentUnit, lectureId); authorizationCheckService.checkHasAtLeastRoleInCourseElseThrow(Role.EDITOR, attachmentUnit.getLecture().getCourse(), null);