Логика получения idCustomer заменена на готовый метод GetCustomerId()

This commit is contained in:
KharchenkoVV 2021-05-17 16:30:53 +05:00
parent 583866d75d
commit c77a4e69a3

View File

@ -22,14 +22,9 @@ namespace AsbCloudWebApi.Controllers
[ProducesResponseType(typeof(IEnumerable<WellDto>), (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);
}