2026-03-19 13:35:53 +01:00
|
|
|
using CPATapi.Server.Interfaces;
|
2026-03-18 11:27:11 +01:00
|
|
|
using CPATapi.Server.Models;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
2026-03-19 13:35:53 +01:00
|
|
|
namespace CPATapi.Server.Controllers;
|
|
|
|
|
|
|
|
|
|
[ApiController]
|
|
|
|
|
[Route("[controller]")]
|
|
|
|
|
public class ContactController(ILogger<ContactController> logger, ITapiDirectoryRepository tapiDirectory) : ControllerBase
|
2026-03-18 11:27:11 +01:00
|
|
|
{
|
2026-03-19 13:35:53 +01:00
|
|
|
|
|
|
|
|
private readonly ILogger<ContactController> _logger = logger;
|
|
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[Produces("application/json")]
|
|
|
|
|
[ProducesResponseType<IEnumerable<TapiContact>>(StatusCodes.Status200OK)]
|
|
|
|
|
public async Task<IActionResult> GetAsync()
|
2026-03-18 11:27:11 +01:00
|
|
|
{
|
2026-03-19 13:35:53 +01:00
|
|
|
return Ok(await tapiDirectory.GetAllAsync());
|
2026-03-18 11:27:11 +01:00
|
|
|
}
|
|
|
|
|
}
|