This commit is contained in:
Riccardo Usardi committed 2025-07-20 11:49:20 +02:00
1 parent 3a1a0ca7ef
commit 6bce1d9330
9 files changed
+167 -13

No files matched your search

+5 -1
View File
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using uWine.Core.Domain.Entities;
using uWine.Core.Infrastructure.Services;
@@ -35,13 +36,16 @@ namespace uWine.Api.Controllers
}
[HttpGet("get-area")]
[ProducesResponseType(typeof(Dictionary<int, Coordinates>), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
public IActionResult GetArea(int vineyardId)
{
try
{
var area = _coordinatesService.GetArea(vineyardId);
if (area == null || area.Count == 0)
return NotFound("No area found for the given vineyard ID");
return NotFound();
return Ok(area);
}