From c77a4e69a38b2fe0721fe36d0a716addfaf3a830 Mon Sep 17 00:00:00 2001 From: KharchenkoVV Date: Mon, 17 May 2021 16:30:53 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=BE=D0=B3=D0=B8=D0=BA=D0=B0=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=BB=D1=83=D1=87=D0=B5=D0=BD=D0=B8=D1=8F=20idCustomer?= =?UTF-8?q?=20=D0=B7=D0=B0=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B0=20=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=B3=D0=BE=D1=82=D0=BE=D0=B2=D1=8B=D0=B9=20=D0=BC?= =?UTF-8?q?=D0=B5=D1=82=D0=BE=D0=B4=20GetCustomerId()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudWebApi/Controllers/WellController.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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); }