19 lines
611 B
C#
19 lines
611 B
C#
using Bookie.Application.DTOs.Teams;
|
|
using Bookie.Application.Interfaces;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace Bookie.Api.Controllers;
|
|
|
|
[Route("api/teams")]
|
|
public class TeamsController : CrudControllerBase<TeamDto, TeamCreateDto, TeamUpdateDto>
|
|
{
|
|
private readonly ITeamService _teams;
|
|
|
|
public TeamsController(ITeamService service) : base(service) => _teams = service;
|
|
|
|
/// <summary>Unpaged list of all teams (for dropdowns).</summary>
|
|
[HttpGet("all")]
|
|
public async Task<ActionResult<IReadOnlyList<TeamDto>>> GetAll(CancellationToken ct)
|
|
=> Ok(await _teams.GetAllAsync(ct));
|
|
}
|