fix
This commit is contained in:
parent
3db96eaaa1
commit
f749e8fcb4
@ -45,12 +45,6 @@
|
||||
<h2 class="display-4">Покупки</h2>
|
||||
</div>
|
||||
<div class="text-center" name="id">
|
||||
@{
|
||||
if (Model == null)
|
||||
{
|
||||
<h3 class="display-4">Авторизируйтесь</h3>
|
||||
return;
|
||||
}
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
@ -72,26 +66,6 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Id)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.DatePurchase)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Sum)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.PurchaseStatus)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.UserLogin)
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
|
@ -15,13 +15,10 @@ namespace HardwareShopRestApi.Controllers
|
||||
|
||||
private readonly IUserLogic _logic;
|
||||
|
||||
private readonly IPurchaseLogic _purchaseLogic;
|
||||
|
||||
public ClientController(IUserLogic logic, IPurchaseLogic purchaseLogic, ILogger<ClientController> logger)
|
||||
public ClientController(IUserLogic logic, ILogger<ClientController> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
_logic = logic;
|
||||
_purchaseLogic = purchaseLogic;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
@ -55,20 +52,5 @@ namespace HardwareShopRestApi.Controllers
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public List<PurchaseViewModel>? GetPurchases(int userId)
|
||||
{
|
||||
try
|
||||
{
|
||||
return _purchaseLogic.ReadList(new PurchaseSearchModel { UserId = userId });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка получения списка заказов клиента id={Id}", userId);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user