mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-12-16 10:05:05 -05:00
Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com> Co-authored-by: Robbie Davis <robbie@therobbiedavis.com>
24 lines
688 B
C#
24 lines
688 B
C#
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using API.Constants;
|
|
using API.Data;
|
|
using API.DTOs.Progress;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace API.Controllers;
|
|
|
|
public class ActivityController(IUnitOfWork unitOfWork) : BaseApiController
|
|
{
|
|
/// <summary>
|
|
/// Returns active reading sessions on the Server
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[Authorize(PolicyGroups.AdminPolicy)]
|
|
[HttpGet("current")]
|
|
public async Task<ActionResult<List<ReadingSessionDto>>> GetActiveReadingSessions()
|
|
{
|
|
return Ok(await unitOfWork.ReadingSessionRepository.GetAllReadingSessionAsync());
|
|
}
|
|
}
|