Feat Widgets Controles y Estilos

This commit is contained in:
2025-10-03 13:26:20 -03:00
parent 1719e79723
commit 64d45a7a39
17 changed files with 544 additions and 278 deletions

View File

@@ -175,4 +175,20 @@ public class CatalogosController : ControllerBase
return Ok(establecimientos);
}
/// <summary>
/// Obtiene la lista de municipios (partidos) para un distrito (provincia) específico.
/// </summary>
[HttpGet("municipios-por-distrito/{distritoId}")]
public async Task<IActionResult> GetMunicipiosPorDistrito(string distritoId)
{
var municipios = await _dbContext.AmbitosGeograficos
.AsNoTracking()
.Where(a => a.NivelId == 30 && a.DistritoId == distritoId) // Nivel 30 = Municipio
.OrderBy(a => a.Nombre)
.Select(a => new { Id = a.Id.ToString(), a.Nombre }) // Devolvemos el ID de la BD como string
.ToListAsync();
return Ok(municipios);
}
}