diff --git a/AsbCloudWebApi/Controllers/WellController.cs b/AsbCloudWebApi/Controllers/WellController.cs index 9530eceb..003cf391 100644 --- a/AsbCloudWebApi/Controllers/WellController.cs +++ b/AsbCloudWebApi/Controllers/WellController.cs @@ -22,14 +22,9 @@ namespace AsbCloudWebApi.Controllers [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] public IActionResult GetWells() { - var claimIdCustomer = User.FindFirst("IdCustomer"); + var idCustomer = User.GetCustomerId(); - if (claimIdCustomer is null) - return NoContent(); - - var idCustomer = int.Parse(claimIdCustomer.Value); - - var wells = wellService.GetWellsByCustomer(idCustomer); + var wells = wellService.GetWellsByCustomer((int)idCustomer); return Ok(wells); }