Skip to content
Snippets Groups Projects

Add an endpoint for getting sessions with grace period

Files

@@ -107,6 +107,21 @@ public class SessionController {
return View.convert(sr.findAllActiveInEdition(editionIds), SessionDetailsDTO.class);
}
/**
* Gets all sessions that are currently active within one of the given editions.
*
* @param editionIds The list of edition ids to search from.
* @return The list of all found sessions.
*/
@GetMapping("active-now-and-by-edition-with-grace-period")
@PreAuthorize("hasAuthority('SESSION_READ')")
public List<SessionDetailsDTO> getActiveSessionsInEditionsWithGracePeriod(
@RequestParam List<Long> editionIds,
@RequestParam Integer gracePeriod) {
return View.convert(sr.findAllActiveInEditionWithGracePeriod(editionIds, gracePeriod),
SessionDetailsDTO.class);
}
/**
* Deletes a session.
*
Loading