mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-05-24 00:52:23 -04:00
30 lines
653 B
C#
30 lines
653 B
C#
using System.Threading.Tasks;
|
|
using API.Data;
|
|
using API.Data.Repositories;
|
|
using API.DTOs;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace API.Controllers;
|
|
|
|
public class ChapterController : BaseApiController
|
|
{
|
|
private readonly IUnitOfWork _unitOfWork;
|
|
|
|
public ChapterController(IUnitOfWork unitOfWork)
|
|
{
|
|
_unitOfWork = unitOfWork;
|
|
}
|
|
|
|
[HttpGet]
|
|
public async Task<ActionResult<ChapterDto>> GetChapter(int chapterId)
|
|
{
|
|
var chapter =
|
|
await _unitOfWork.ChapterRepository.GetChapterDtoAsync(chapterId,
|
|
ChapterIncludes.People | ChapterIncludes.Files);
|
|
|
|
return Ok(chapter);
|
|
}
|
|
|
|
|
|
}
|