Skip to content

Commit

Permalink
add server tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesWt committed Sep 30, 2024
1 parent 13e1d48 commit 617679c
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@ public void startLearningPathForCurrentUser(long learningPathId) {
if (!learningPath.getUser().equals(currentUser)) {
throw new AccessForbiddenException("You are not allowed to start this learning path.");
}
else if (learningPath.isStartedByStudent()) {
throw new BadRequestException("Learning path already started.");
}
learningPath.setStartedByStudent(true);
learningPathRepository.save(learningPath);
}
Expand Down
Loading

0 comments on commit 617679c

Please sign in to comment.